Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24055] Android: Enabling push notifications crashes the app with latest 6.0.0.v20161019091022

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-26T21:52:11.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsqe-6.0.0, regression
ReporterLokesh Choudhary
AssigneeGary Mathews
Created2016-10-19T21:13:19.000+0000
Updated2016-10-27T19:48:02.000+0000

Description

*This is a regression.*

Steps to reproduce:

1. Use the example app in the cloud module to check for push. 2. Make sure you are setup properly for push notifications. 3. Build the app for android device. 4. After the app launches login/create a user. 5. Go to Push Notifications -> Setting For This Device -> Enable. 6. Click on Enable.

Actual Results:

1. The app crashes with logs:
[ERROR] :  GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[DEBUG] :  D/com.appcelerator.aps.CCPushService: Got GCM SenderID from ACS: 533264433538
[ERROR] :  GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[DEBUG] :  D/com.appcelerator.aps.CCPushService: GCM RegistrationId not found. Need to make request to generate.
[ERROR] :  TiApplication: (AsyncTask #4) [1225,31044] Sending event: exception on thread: AsyncTask #4 msg:java.lang.RuntimeException: An error occurred while executing doInBackground(); Titanium 6.0.0,2016/10/19 09:10,undefined
[ERROR] :  TiApplication: java.lang.RuntimeException: An error occurred while executing doInBackground()
[ERROR] :  TiApplication: 	at android.os.AsyncTask$3.done(AsyncTask.java:309)
[ERROR] :  TiApplication: 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
[ERROR] :  TiApplication: 	at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
[ERROR] :  TiApplication: 	at java.util.concurrent.FutureTask.run(FutureTask.java:242)
[ERROR] :  TiApplication: 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
[ERROR] :  TiApplication: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
[ERROR] :  TiApplication: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
[ERROR] :  TiApplication: 	at java.lang.Thread.run(Thread.java:818)
[ERROR] :  TiApplication: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/iid/zzc;
[ERROR] :  TiApplication: 	at com.google.android.gms.gcm.GoogleCloudMessaging.zzde(Unknown Source)
[ERROR] :  TiApplication: 	at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
[ERROR] :  TiApplication: 	at com.appcelerator.aps.CCPushService$3.doInBackground(CCPushService.java:393)
[ERROR] :  TiApplication: 	at com.appcelerator.aps.CCPushService$3.doInBackground(CCPushService.java:384)
[ERROR] :  TiApplication: 	at android.os.AsyncTask$2.call(AsyncTask.java:295)
[ERROR] :  TiApplication: 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
[ERROR] :  TiApplication: 	... 4 more
[ERROR] :  TiApplication: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.iid.zzc" on path: DexPathList[[zip file "/data/app/com.app.cloudpushprod-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.cloudpushprod-1/lib/arm, /data/app/com.app.cloudpushprod-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
[ERROR] :  TiApplication: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[ERROR] :  TiApplication: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[ERROR] :  TiApplication: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[ERROR] :  TiApplication: 	... 10 more
[ERROR] :  TiApplication: 	Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.iid.zzc
[ERROR] :  TiApplication: 		at java.lang.Class.classForName(Native Method)
[ERROR] :  TiApplication: 		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[ERROR] :  TiApplication: 		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[ERROR] :  TiApplication: 		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[ERROR] :  TiApplication: 		... 11 more
[ERROR] :  TiApplication: 	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
[DEBUG] :  OpenGLRenderer: endAllStagingAnimators on 0x9d291b80 (RippleDrawable) with handle 0xb4cffa80
[DEBUG] :  Window: Window is closed normally.

Expected Results:

1. The app should not crash when push notifications are enabled.

Comments

  1. Gary Mathews 2016-10-20

    https://github.com/appcelerator-modules/cloudpush/pull/31 https://github.com/appcelerator-modules/cloudpush/releases/tag/android-4.0.3
  2. Lokesh Choudhary 2016-10-20

    [~gmathews], Dexer fails with cloudpush module 4.0.3
       [ERROR] :  Failed to run dexer:
       [ERROR] :  
       [ERROR] :  PARSE ERROR:
       [ERROR] :  class name (com/google/android/gms/iid/InstanceID) does not match path (com/google/android/iid/InstanceID.class)
       [ERROR] :  ...while parsing com/google/android/iid/InstanceID.class
       [ERROR] :  1 error; aborting
       
  3. Gary Mathews 2016-10-24

    [~lchoudhary] What device and Android version are you using?
  4. Lokesh Choudhary 2016-10-25

    [~gmathews], Nexus 6 running android 6.0.1
  5. Gary Mathews 2016-10-26

    [~lchoudhary] Updated 4.0.3: https://github.com/appcelerator-modules/cloudpush/releases/tag/android-4.0.3 It works on my Galaxy S7
  6. Lokesh Choudhary 2016-10-26

    [~gmathews], I checked with fixed 4.0.3 module mentioned in the above comment & I do not see any crash. Please resolve the ticket so that it can be closed.
  7. Lokesh Choudhary 2016-10-27

    Verified the fix with the updated cloudpush module 4.0.3 & no crash are seen when push notifications as enabled. Closing. Appc Studio : 4.8.0.201610171310 SDK Version : 6.0.0.v20161026195651 Mac OS Version : 10.11.6 Xcode Version : Xcode 8.0 Build version 8A218a Appc CLI AND Appc NPM : {"NPM":"4.2.7","CLI":"6.0.0-67"} Ti CLI : 5.0.10 Alloy : 1.9.4 Node : v4.6.0 Nexus 6 running 6.0.1

JSON Source