Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

App crashes with the latest updates of Android SDK with plugin v-1.9.2 #1591

Closed
razam217 opened this issue Feb 17, 2017 · 21 comments
Closed

Comments

@razam217
Copy link

Expected Behaviour

Actual Behaviour

I just updated my sdk packages, cordova and cordova-platforms, and updated phonegap-plugin-push to 1.9.2 and now I can't run my app. It is crashing. Also I can see a exception in my logs:

02-17 18:23:49.443 28689-28926/com.abode.abode E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-4
Process: com.abode.abode, PID: 28689
java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/com.abode.abode-1/base.apk)
at com.google.android.gms.iid.zzd.zzkq(Unknown Source)
at com.google.android.gms.iid.zzd.(Unknown Source)
at com.google.android.gms.iid.zzd.(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.adobe.phonegap.push.PushPlugin$1.run(PushPlugin.java:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
02-17 18:23:49.513 28689-28689/com.abode.abode D/CordovaActivity: Paused the activity.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Just install latest updates of sdk and try to run on android.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 5.0.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Samsung Galaxy Note III

Cordova CLI version and cordova platform version

cordova --version                                    # e.g. 6.5.0
cordova platform version android                     # e.g. 6.1.2

Plugin version

cordova plugin version | grep phonegap-plugin-push   # e.g. 1.9.2
@macdonst
Copy link
Member

@razam217 what version of Google Play Services and Support Library are you building with? I have the latest Android SDK, etc and my app does not crash.

@razam217
Copy link
Author

razam217 commented Feb 17, 2017

Google Play Services: 39
Android Support Repository: 43
Android Support Library: 23.2.1

@razam217
Copy link
Author

Node Version 6.9.5

@pitAlex
Copy link

pitAlex commented Feb 18, 2017

I confirm its happening to me too after updating to the sdk. It crashes saying:

java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw'

I there anyway to downgrade the sdk until this gets fixed? I've searched high and low but could not find a proper way to do it. Just downgrading the tools will not fix it. It like you need the entire previous sdk.

@macdonst
Copy link
Member

@razam217 and @pitAlex can you please install the latest from master as the quick change I did should fix your issue but since I couldn't reproduce it I can't know for sure and I need you help. Thanks.

@uj
Copy link

uj commented Feb 18, 2017

That change seems to cause Phone Gap Build to fail with the following error:

You have not accepted the license agreements of the following SDK components:
[SDK Patch Applier v4, Android Support Repository, Google Repository].

Of course, I have no way to accept the license agreement on behalf of PGB.

@razam217
Copy link
Author

My issue is fixed, before I was using sdk dowloaded manually. When I used the SDK downloaded by Android SDK, the issue fixed, I guess my SDK had something un-necessary packages installed or something like that.

@razam217
Copy link
Author

I would suggest uninstall Android studio and install it once again, and then try to build your project again. It will download the latest SDK with the minimal required dependencies.

@pitAlex
Copy link

pitAlex commented Feb 19, 2017

Its not this that causing the problem, I've tracked it down. Its the google analytics plugin. Somehow that plugin causes conflicts between the google play services version. Changing:
compile "com.google.android.gms:play-services-gcm:9.8+" to compile "com.google.android.gms:play-services-gcm:+" seems to fix it.

P.S:
I just noticed you guys changed the dependency as well to be 10.2+.
My project build now, thanks.

@macdonst
Copy link
Member

macdonst commented Feb 19, 2017 via email

@pitAlex
Copy link

pitAlex commented Feb 19, 2017

@Removed-5an
Copy link

Ah this explains why my app wouldn't run anymore? Can you publish a new version on NPM please?

@kaynz
Copy link

kaynz commented Feb 20, 2017

I can confirm the issue using 1.9.3 and latest android sdk stuff.

This <framework src="com.google.android.gms:play-services-gcm:+"/>fixes the problem.

@Removed-5an
Copy link

@kaynz but how can I use this fix without a new version of phonegap-plugin-push? If I change the plugin.xml I won't see the changes reflected with cordova build or cordova run?

@fredgalvao
Copy link
Collaborator

If you want to use/test what's been commited without having to wait for an official release, you can always install directly from github:

cordova plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="XXXXXXX"

@macdonst
Copy link
Member

I bumped the plugin to 1.9.4 for folks running into this issue.

@Jori1
Copy link

Jori1 commented Feb 24, 2017

Is there any solution to Phonegap Build users?
As far as i know PhoneGap Build does not support 1.9.X-version of this plugin, so i cannot update to 1.9.4 version?

I'm currently using PhoneGap Build CLI-6.3.0 for android and phonegap-plugin-push version 1.8.4.

@uj
Copy link

uj commented Feb 24, 2017

Phonegap Build works fine with 1.9.3, I use it myself. Just don't use 1.9.4 yet until PhoneGap Build has Google Play Services 10+ support.

@Jori1
Copy link

Jori1 commented Feb 24, 2017

Actually i just tested my application with push plugin version 1.9.4, cli-6.5.0 and push notifications are working, so what is this Google Play Services 10+ support?

@uj
Copy link

uj commented Feb 24, 2017

If it builds successfully in Phonegap Build with 1.9.4, then that means Adobe has added Play Services 10 support to their system. It wasn't available there a few days ago, so if you say that it built without errors in PGB, then they probably recently updated it.

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

8 participants