Uploaded image for project: 'Appcelerator Modules'
  1. Appcelerator Modules
  2. MOD-2498

ti.cloudpush (version 6.0.0) : Conflicting jar files with titanium sdk 7.5.1.GA

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 6.0.0
    • Fix Version/s: Release 8.0.0
    • Component/s: CloudPush
    • Labels:
      None
    • Environment:
    • Story Points:
      5
    • Sprint:
      2019 Sprint 5

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                aislam Aminul Islam
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code