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

Crash on PushNotification.hasPermission on android below API 19 #511

Closed
ASGAlex opened this issue Jan 14, 2016 · 4 comments
Closed

Crash on PushNotification.hasPermission on android below API 19 #511

ASGAlex opened this issue Jan 14, 2016 · 4 comments

Comments

@ASGAlex
Copy link

ASGAlex commented Jan 14, 2016

I have got fatal error and crash by calling PushNotification.hasPermission on androin 4.2.1
Here is the error log from the Android Device Manager:

01-15 00:16:44.720: E/dalvikvm(27140): Could not find class 'android.app.AppOpsManager', referenced from method com.adobe.phonegap.push.PermissionUtils.hasPermission 01-15 00:16:44.728: E/AndroidRuntime(27140): FATAL EXCEPTION: pool-2-thread-2 01-15 00:16:44.728: E/AndroidRuntime(27140): java.lang.NoClassDefFoundError: android.app.AppOpsManager 01-15 00:16:44.728: E/AndroidRuntime(27140): at com.adobe.phonegap.push.PermissionUtils.hasPermission(PermissionUtils.java:17) 01-15 00:16:44.728: E/AndroidRuntime(27140): at com.adobe.phonegap.push.PushPlugin$3.run(PushPlugin.java:171) 01-15 00:16:44.728: E/AndroidRuntime(27140): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 01-15 00:16:44.728: E/AndroidRuntime(27140): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 01-15 00:16:44.728: E/AndroidRuntime(27140): at java.lang.Thread.run(Thread.java:838) 01-15 00:16:44.767: E/AppErrorDialog(529): Failed to get ILowStorageHandle instance 01-15 00:16:45.460: E/webview(27140): Error: WebView.destroy() called while still attached!

According to android reference, AppOpsManager exists since API 19. Android 4.2.1 is about API 14 or 15. So,exception handling is not enough to prevent application crash.

@fredgalvao
Copy link
Collaborator

I'll be closing this as a duplicate for now.
See #495 for details. Basically, that is indeed a bug, it's been fixed in master today, and will be release as 1.5.3 very soon.

For now, you can re-install the plugin using git pointing to the master branch, or keep track of the patch release at #508.

Feel free to re-open this if none of the above fixes that issue for you.

@ASGAlex
Copy link
Author

ASGAlex commented Jan 14, 2016

Yes, it works on master, thank you!

@fredgalvao
Copy link
Collaborator

@ASGAlex 1.5.3 is out already, you should use it (instead of pointing to master 😉 ).

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

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

No branches or pull requests

2 participants