distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

Local Notification ANE crashes the app on some devices #198

Closed lazer closed 9 years ago

lazer commented 10 years ago

We are using local notifications ANE and it works fine on most of our devices, but crashes the app on Samsung GT-I18189 Android 4.1.2

After the first notification comes, it immediately crashes the app and no other scheduled notifications manage to come.

Kernel 3.0.31.-1332988

There’s no valuable info in debug mode to share with you guys, so far this is all the info i can provide. I can also send you a short video of this bug being reproduced, but basically the notification just comes and the app crashes.

marchbold commented 10 years ago

Can you provide the output from the android debugger while running the application on a connected device? You'll need to run the following in a terminal or such:

adb logcat
lazer commented 10 years ago

09-02 16:59:43.461: I/com.distriqt.Notifications::NotificationsReceiver(11625): onReceive 09-02 16:59:43.461: D/com.distriqt.Notifications::NotificationsReceiver(11625): handleIntent( com.game.FairyTales.DELAYED_NOTIFICATION ) 09-02 16:59:43.461: I/com.distriqt.Notifications::NotificationsReceiver(11625): Delayed notification 09-02 16:59:43.461: I/com.distriqt.Notifications::NotificationsReceiver(11625): Delayed notification [19] LocalNotifications/tickerText4 : (Some notification data to attach LocalNotifications/bodyText4 LocalNotifications/bodyText4) repeat=0 09-02 16:59:43.461: D/ApplicationPolicy(2022): isStatusBarNotificationAllowed: packageName = com.game.FairyTales 09-02 16:59:43.461: D/STATUSBAR-NotificationService(2022): Noti Alert - mSystemReady:true, AlertEnabled:true 09-02 16:59:43.461: D/PhoneStatusBar(2126): addNotification score=0 09-02 16:59:43.471: D/AndroidRuntime(11625): Shutting down VM 09-02 16:59:43.471: W/dalvikvm(11625): threadid=1: thread exiting with uncaught exception (group=0x40f682a0) 09-02 16:59:43.471: D/STATUSBAR-NotificationService(2022): Noti Alert - doVibrate 09-02 16:59:43.481: E/AndroidRuntime(11625): FATAL EXCEPTION: main 09-02 16:59:43.481: E/AndroidRuntime(11625): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.game.FairyTales.DELAYED_NOTIFICATION flg=0x14 (has extras) } in com.distriqt.extension.notifications.NotificationsReceiver@41a11368 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:765) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.os.Handler.handleCallback(Handler.java:615) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.os.Handler.dispatchMessage(Handler.java:92) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.os.Looper.loop(Looper.java:137) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.ActivityThread.main(ActivityThread.java:4867) 09-02 16:59:43.481: E/AndroidRuntime(11625): at java.lang.reflect.Method.invokeNative(Native Method) 09-02 16:59:43.481: E/AndroidRuntime(11625): at java.lang.reflect.Method.invoke(Method.java:511) 09-02 16:59:43.481: E/AndroidRuntime(11625): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007) 09-02 16:59:43.481: E/AndroidRuntime(11625): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774) 09-02 16:59:43.481: E/AndroidRuntime(11625): at dalvik.system.NativeStart.main(Native Method) 09-02 16:59:43.481: E/AndroidRuntime(11625): Caused by: java.lang.SecurityException: Requires VIBRATE permission 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.os.Parcel.readException(Parcel.java:1425) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.os.Parcel.readException(Parcel.java:1379) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:313) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.NotificationManager.notify(NotificationManager.java:127) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.NotificationManager.notify(NotificationManager.java:106) 09-02 16:59:43.481: E/AndroidRuntime(11625): at com.distriqt.extension.notifications.NotificationsReceiver.handleIntent(NotificationsReceiver.java:131) 09-02 16:59:43.481: E/AndroidRuntime(11625): at com.distriqt.extension.notifications.NotificationsReceiver.onReceive(NotificationsReceiver.java:49) 09-02 16:59:43.481: E/AndroidRuntime(11625): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:755) 09-02 16:59:43.481: E/AndroidRuntime(11625): ... 9 more 09-02 16:59:43.551: D/dalvikvm(2126): GC_FOR_ALLOC freed 705K, 18% free 17486K/21255K, paused 50ms, total 61ms 09-02 16:59:43.551: I/dalvikvm-heap(2126): Grow heap (frag case) to 19.394MB for 1048592-byte allocation 09-02 16:59:43.551: E/android.os.Debug(2022): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error 09-02 16:59:43.561: I/dumpstate(11976): begin

marchbold commented 9 years ago

Hi, I missed this update sorry.

I've been looking through your logs and noticed

09-02 16:59:43.481: E/AndroidRuntime(11625): Caused by: java.lang.SecurityException: Requires VIBRATE permission

You might try adding the following to your application descriptor:

<uses-permission android:name="android.permission.VIBRATE"/>

Your manifest additions should look something like the following:

<android>
    <manifestAdditions><![CDATA[
        <manifest android:installLocation="auto" >
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.VIBRATE"/>
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

            <application> 
                <receiver android:name="com.distriqt.extension.notifications.NotificationsReceiver">
                    <intent-filter>
                        <action android:name="air.com.distriqt.test.NOTIFICATION" />
                        <action android:name="air.com.distriqt.test.DELAYED_NOTIFICATION" />
                    </intent-filter>
                </receiver>
            </application>

        </manifest>
    ]]></manifestAdditions>
</android>

I've updated the latest version to catch this error but try the above and let me know if you are still having an issue.

Cheers