Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2498] ti.cloudpush (version 6.0.0) : Conflicting jar files with titanium sdk 7.5.1.GA

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-03-04T16:18:11.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 8.0.0
ComponentsCloudPush
Labelsn/a
ReporterAminul Islam
AssigneeGary Mathews
Created2019-02-27T13:50:17.000+0000
Updated2019-03-08T06:18:00.000+0000

Description

Hello! I have updated my titanium sdk to the last version (7.5.1), but after that when I try to compile my app with to ti.cloudpush (version 6.0.0) on android device I get this error:
[ERROR] :  Conflicting jar files detected:
[ERROR] :  
[ERROR] :  The following modules have different "cloudpush.jar" files
[ERROR] :     ti.cloudpush   (version 6.0.0) (hash=eb23d9d16fd2d1364dc1bd53bc008b28)
[ERROR] :     ti.cloudpush   (version 6.0.0) (hash=5a67a29af933c56d2b30a310d40553fd)
[ERROR] :  
[ERROR] :  You can either select a version of these modules where the conflicting jar file is the same or you
[ERROR] :  can try copying the jar file from one module's "lib" folder to the other module's "lib" folder.
[ERROR] Application Installer abnormal process termination. Process exit value was 1
*Steps to reproduce* 1. Create a new demo project with 7.5.1.GA 2. Included ti.cloudpush (version 6.0.0) and ti.cloud. 3. Add the following code and build on Android devices.
var Cloud = require('ti.cloud');
var CloudPush = require('ti.cloudpush');
var deviceToken = null;

// login info for test propose
var user = "";
var password = "";
var channel = "TestChannel";
var platform = "ios";

// Differern process for Android and iOS platform
if (Ti.Platform.name == 'android') {
	platform = "android";
	
	CloudPush.retrieveDeviceToken({
		success: deviceTokenSuccess,
		error: deviceTokenError
	});
	
	CloudPush.addEventListener('callback', function(evt) {
		alert('Received push: ' + JSON.stringify(evt));
    	Ti.API.info('Received push: ' + JSON.stringify(evt));
	});
	
} else if (parseInt(Ti.Platform.version.split(".")[0]) >= 8) {
    Ti.App.iOS.addEventListener('usernotificationsettings', function registerForPush() {
 
        Ti.App.iOS.removeEventListener('usernotificationsettings', registerForPush); 
 
        Ti.Network.registerForPushNotifications({
            success: deviceTokenSuccess,
            error: deviceTokenError,
            callback: receivePush
        });
    });
    
    Ti.App.iOS.registerUserNotificationSettings({
	    types: [
            Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT,
            Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND,
            Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE
        ]
    });
} else {
	Ti.Network.registerForPushNotifications({
        types: [
            Ti.Network.NOTIFICATION_TYPE_BADGE,
            Ti.Network.NOTIFICATION_TYPE_ALERT,
            Ti.Network.NOTIFICATION_TYPE_SOUND
        ],
        success: deviceTokenSuccess,
        error: deviceTokenError,
        callback: receivePush
    });
}

function loginUser() {
	Cloud.Users.login({
        login: user,
        password: password
    }, function (e) {
        if (e.success) {
            Ti.API.info('Login successful');
            alert("Login successful");
        } else {
            Ti.API.info('Error:\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });
}

function subscribeToChannel() {
	Cloud.PushNotifications.subscribeToken({
        channel: channel,
        device_token: deviceToken,
        type: platform
    }, function (e) {
        if (e.success) {
        	alert('Subscribed');
            Ti.API.info('Subscribed');
        } else {
            Ti.API.info('Error:\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });
}

function unsubscribeToChannel() {
	Cloud.PushNotifications.unsubscribeToken({
        channel: channel,
        device_token: deviceToken
    }, function (e) {
        if (e.success) {
            Ti.API.info('Unsubscribed');
        } else {
            Ti.API.info('Error:\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });;
}

function deviceTokenSuccess(e) {
	deviceToken = e.deviceToken;
	Ti.API.info("Device Registered Successfully.\nThe Device Token is: " + deviceToken);
	loginUser();
}

function deviceTokenError(e) {
	alert("Failed to register for push notifications!\nThe Error is: " + e.error);
	Ti.API.info("Failed to register for push notifications!\nThe Error is: " + e.error);
}

function receivePush(e) {
    alert('Received push: ' + JSON.stringify(e));
    Ti.API.info('Received push: ' + JSON.stringify(e));
}

var win = Ti.UI.createWindow({
    backgroundColor: 'white',
    layout:'vertical',
    exitOnClose: true
});
 
var subscribe = Ti.UI.createButton({
	title:'Subscribe',
	top: 100,
	left: 100
});
subscribe.addEventListener('click', subscribeToChannel);
win.add(subscribe);
 
var unsubscribe = Ti.UI.createButton({
	title:'Unsubscribe',
	top: 150,
	left: 100
});
unsubscribe.addEventListener('click', unsubscribeToChannel);
win.add(unsubscribe);
 
win.open();
Test Environment: 1. TiSDK 7.5.1.GA 2. Ti.cloudpush (version 6.0.0) 3. Android 8 Note: We don't have any other module in our project. You can reproduce this error with cloudpush module only. Thanks

Comments

  1. Gary Mathews 2019-02-28

    ti.cloudpush: https://github.com/appcelerator-modules/cloudpush/releases/download/android-6.0.1/ti.cloudpush-android-6.0.1.zip
  2. Gary Mathews 2019-02-28

    8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10737 7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10738
  3. Arbind 2019-03-04

    I am also having the exact same issue.
  4. Lokesh Choudhary 2019-03-06

    Verified the fix with SDK 7.5.2.v20190304130819 & 8.0.0.v20190306054146. Closing.
  5. Arbind 2019-03-07

    I just now tested a blank project with cloudpush module in it, and it gets stuck at the step "Running Dexer" . SDK 7.5.2.v20190304130819 So, it doesn't look like its fixed.
  6. Gary Mathews 2019-03-07

    [~mr.arbindbhagat] I cannot reproduce your issue. I'm using 7.5.2.v20190306131103 with ti.cloudpush-6.0.1 and able to build successfully.
  7. Arbind 2019-03-08

JSON Source