Agasper / unity-android-notifications

Unity3D Plugin for Android local notifications with example project
Other
557 stars 184 forks source link

app crash when app is not currently active #1

Closed omerfarukz closed 9 years ago

omerfarukz commented 9 years ago

tried some variations of this plugin. thats perfect. but i got an issue. created a new notification with 10secs delay and closed application(not exit, only pause). after 10 seconds, app crashed. logs are bellow. thanks.

E/AndroidRuntime(10937): Process: com.omr, PID: 10937 E/AndroidRuntime(10937): java.lang.Error: FATAL EXCEPTION [main] E/AndroidRuntime(10937): Unity version : 5.0.0f4 E/AndroidRuntime(10937): Device model : asus Nexus 7 E/AndroidRuntime(10937): Device fingerprint: google/razor/flo:5.1/LMY47O/1783956:user/release-keys E/AndroidRuntime(10937): E/AndroidRuntime(10937): Caused by: java.lang.RuntimeException: Unable to start receiver net.agasper.unitynotification.UnityNotificationManager: java.lang.NullPointerException E/AndroidRuntime(10937): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2616) E/AndroidRuntime(10937): at android.app.ActivityThread.access$1700(ActivityThread.java:151) E/AndroidRuntime(10937): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380) E/AndroidRuntime(10937): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(10937): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(10937): at android.app.ActivityThread.main(ActivityThread.java:5254) E/AndroidRuntime(10937): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(10937): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(10937): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) E/AndroidRuntime(10937): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) E/AndroidRuntime(10937): Caused by: java.lang.NullPointerException E/AndroidRuntime(10937): at java.lang.Class.classForName(Native Method) E/AndroidRuntime(10937): at java.lang.Class.forName(Class.java:309) E/AndroidRuntime(10937): at java.lang.Class.forName(Class.java:273) E/AndroidRuntime(10937): at net.agasper.unitynotification.UnityNotificationManager.onReceive(UnityNotificationManager.java:88)

Agasper commented 9 years ago

I can't repeat this problem. Please post your manifest file

omerfarukz commented 9 years ago

would you like to share sample project?

Agasper commented 9 years ago

Are you just edit timer in sample project and got that ?

omerfarukz commented 9 years ago

himm, i think its mine problem. your sample project works correctly. what is my mistake? copied asset folder to my project only. what are the next steps can i do?

Agasper commented 9 years ago

Did you edit manifest file ?

omerfarukz commented 9 years ago

no, its identical to yours

Agasper commented 9 years ago

I didn't test it on Unity 5.x, maybe problem in it Try to change private static string unityClass = "com.unity3d.player.UnityPlayerNativeActivity"; to private static string unityClass = "com.unity3d.player.UnityPlayerActivity";

omerfarukz commented 9 years ago

already upgraded your project to untiy 5. its works normally. my project going to crash when suspended or closed.

Agasper commented 9 years ago

Send me your project to agasper@yandex.ru, i'll take a look

omerfarukz commented 9 years ago

removed clear notification code and the problem is solved. i,m not need it. Because notification's not duplicated when i am using same notification id. thank you very much.

Agasper commented 9 years ago

you are welcome

zulqarnain26 commented 6 years ago

Removed clear notification but still getting the same crash