Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
515 stars 197 forks source link

v3.0.3-rc.4 Causes android crash with latest android SDKs #218

Closed cunneen closed 8 years ago

cunneen commented 8 years ago

Running with command:

meteor run android-device --settings settings.json --production --mobile-server=https://my-mobile-server.example.com

With the very latest android SDKs:

, I get the following stacktrace:

05-20 22:52:38.275 16059 16204 E AndroidRuntime: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/com.example.app-1/base.apk)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.google.android.gms.iid.zzd.zzeC(Unknown Source)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at com.adobe.phonegap.push.PushPlugin$1.run(PushPlugin.java:73)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
05-20 22:52:38.275 16059 16204 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:818)

There look to be a couple of related issues on stackoverflow:

cunneen commented 8 years ago

For anyone else who encounters this issue: the following seems to be a workaround:

  1. I copied the android SDK from another machine that was less up-to-date,
  2. set my PATH and ANDROID_HOME to refer to the newly-copied (but older-versioned) SDK,
  3. did a meteor remove-platform android; meteor add-platform android;
  4. rebuilt the app.

No crash, and push notifications resumed functioning. HTH.

macdonst commented 8 years ago

It's an incompatibility between Google Plan Services and the Support Library they released in Android N. Figuring out a way around it.

jerocosio commented 8 years ago

I'm also having this problem but I don't have another machine with a less up-to-date SDK... Any other ideas on how to make this work again.

raix commented 8 years ago

Try rc.5 - ive updated the cordova plugin again

indesignlatam commented 8 years ago

Hello,

I just updated to rc-5 and now this error is appearing. Hope this can help to find the issue.

This happens when i run meteor build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find com.android.support:support-v4:23.4.0.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
         file:/Users/pmogollon/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         file:/Users/pmogollon/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
         file:/Users/pmogollon/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         file:/Users/pmogollon/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
     Required by:va app for Android          -
         :android:unspecified > com.android.support:support-v13:23.3.0
   > Could not find com.android.support:support-v4:23.4.0.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
         file:/Users/pmogollon/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         file:/Users/pmogollon/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
         file:/Users/pmogollon/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
         file:/Users/pmogollon/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.aar
     Required by:
         :android:unspecified > com.google.android.gms:play-services-gcm:8.4.0 > com.google.android.gms:play-services-base:8.4.0 > com.google.android.gms:play-services-basement:8.4.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.507 secs
=> Errors executing Cordova commands:         

   While building Cordova app for platform Android:
   Error code 1 for command: /Applications/MAMP/htdocs/paisano/paisano-app/.meteor/local/cordova-build/platforms/android/gradlew with args:
   cdvBuildDebug,-b,/Applications/MAMP/htdocs/paisano/paisano-app/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

EDIT: I can confirm that everything work as it should on iOS, sound works without any modifications, all works nicely.

Thanks for this great package.

cunneen commented 8 years ago

I updated my android SDK to the latest, and updated to rc.5, and it all seems to work well.

Thanks again for your work on this!