taivo / parse-push-plugin

Push notification plugin for Cordova/Phonegap/ionic on Parse platform
118 stars 102 forks source link

Latest version crashes on Android #58

Closed ladmerc closed 8 years ago

ladmerc commented 8 years ago

I installed the current commit 239951caaf82f99ab378dddae16006af87f4e7d9 and it's been crashing on Android. I've uninstalled the plugin on three occasions and app runs well on device and emulator. Reinstall the plugin, and it crashes:

Logcat.txt says something about skipping too many frames (about 50-60)

vesters commented 8 years ago

+1

taivo commented 8 years ago

@vesters are you getting the same error about skipping too many frames?

Right now I'm not entirely sure how that can possibly be related to this notification plugin

taivo commented 8 years ago

Also, can you guys check the application tag in your android manifest? Make sure the android:name attribute says github.taivo.parsepushplugin.ParsePushApplication

Please see my last post on issue #55 for more info. And let me know how things go. I'll do my best to help.

vesters commented 8 years ago

@taivo I don't actually know if that's the error I'm getting. I don't know how to get the logs, because the crash happens right after open.

I just narrowed the crash down to this plugin, and it was working on my last release a couple of months ago.

I have successfully created a fresh ionic install with this plugin, that doesn't crash though.

quilligana commented 8 years ago

I can confirm the same issue and that uninstalling and re-installing the plugin fixes the issue as per @taivo post on #55 (i.e. android:name in application tag of android manifest). Not sure why the issue happened in the first place though.

taivo commented 8 years ago

@vesters, @ladmerc, have you guys had a chance to check the manifest?

To view log, just turn on adb logcat on the console while your phone is connected to computer via usb.

There is something weird happening with the Cordova hook that sets android:name. I'm wondering if another plugin clears that entry. If possible, can you list your plugins here? I can do some inspection when I get a chance.

Thanks

vesters commented 8 years ago

I haven't looked at it further, since a fresh Ionic install took care of the problem for me - obviously not something I'd like to do often though :)

Here are my list of plugins:

cordova-fabric-plugin 1.0.8 "cordova-fabric-plugin" cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-console 1.0.3 "Console" cordova-plugin-device 1.1.2 "Device" cordova-plugin-facebook4 1.7.2 "Facebook Connect" cordova-plugin-firebase 0.1.10 "Google Firebase Plugin" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-statusbar 2.1.3 "StatusBar" cordova-plugin-whitelist 1.2.2 "Whitelist" ionic-plugin-keyboard 2.2.1 "Keyboard" parse-push-plugin 1.0.5 "ParsePushPlugin" phonegap-plugin-push 1.8.1 "PushPlugin"

On Tue, 6 Sep 2016 at 21:08 taivo notifications@github.com wrote:

@vesters https://github.com/vesters, @ladmerc https://github.com/ladmerc, have you guys had a chance to check the manifest?

To view log, just turn on adb logcat on the console while your phone is connected to computer via usb.

There is something weird happening with the Cordova hook that sets android:name. I'm wondering if another plugin clears that entry. If possible, can you list your plugins here? I can do some inspection when I get a chance.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/taivo/parse-push-plugin/issues/58#issuecomment-245056705, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhR6W9HFKiiYooSkOm68V9Z6S1WL3ftks5qnboZgaJpZM4JcVes .

taivo commented 8 years ago

@vesters, thank you for your list.

vesters commented 8 years ago

@taivo Thank you for working on the plugin. Would be lost without it!

ladmerc commented 8 years ago

Didn't check the Manifest as I had to use another plugin instead.

Cheers man!

quilligana commented 8 years ago

I've noticed that if I cordova platform rm android and then cordova platform add android the android:name tag in application of config.xml is missing. Uninstalling the plugin and reinstalling then solves this:

cordova plugin rm parse-push-plugin
cordova plugin add https://github.com/taivo/parse-push-plugin

and hence the crashing issues.

taivo commented 8 years ago

@quilligana, that observation makes a lot of sense given some of the unexplained disappearance of android:name in the manifest.

That attribute is filled via a cordova hook during the plugin installation phase. When the Android platform is removed, that change is deleted along with the manifest file. When the Android platform is re-added, the manifest is the default one with no application android:name.

Perhaps I can move the android:name setup to the after_prepare hook instead.

Thanks for sharing your insight.