rosjava / android_core

Android libraries for rosjava
145 stars 166 forks source link

NodeMainExecutorService notification crashes on click #283

Open simbelmine opened 6 years ago

simbelmine commented 6 years ago

minSdkVersion 23 targetSdkVersion 26 android_core: android_10:0.3.3 Galaxy Tab S2 SM-T810

TYPE_SYSTEM_ALERT _This constant was deprecated in API level 26. for non-system apps. Use TYPE_APPLICATIONOVERLAY instead.

https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_SYSTEM_ALERT

When NodeMainExecutorService notification is clicked the app crashes with:

> 06-07 10:34:42.181 5263-5263/? E/AndroidRuntime: FATAL EXCEPTION: main
>     Process: com.here.rcp.htcontrol, PID: 5263
>     android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@dd013e1 -- permission denied for window type 2003
>         at android.view.ViewRootImpl.setView(ViewRootImpl.java:921)
>         at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
>         at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:97)
>         at android.app.Dialog.show(Dialog.java:408)
>         at org.ros.android.NodeMainExecutorService$1.run(NodeMainExecutorService.java:161)
>         at android.os.Handler.handleCallback(Handler.java:751)
>         at android.os.Handler.dispatchMessage(Handler.java:95)
>         at android.os.Looper.loop(Looper.java:154)
>         at android.app.ActivityThread.main(ActivityThread.java:6780)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
>         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
>       Suppressed: java.lang.Throwable: HERE SDK Version: 3.7.0.118
>         at com.nokia.maps.MapsEngine$l.uncaughtException(MapsEngine.java:378)
>         at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
>         at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
jubeira commented 6 years ago

Hi @simbelmine,

The current codebase probably doesn't support SDK 26, as some permissions may have been changed. The last API version I tried was 25. If you don't need features in 26, I would recommend downgrading the target. Otherwise, if you want to send a fix that works with the newer permission models, I would be happy to review it. The fix should probably be applying the suggestion in the error message. I would do it myself, but I've been pretty packed lately.

simbelmine commented 6 years ago

Thank you, jubeira!

blmhemu commented 5 years ago

Hey I have done some fix : https://github.com/blmhemu-rosjava/android_core This worked for me.