Robotics StackExchange | Archived questions

Rosmater Chooser Problem

Hello

I have created a new Android Studio then I added all needed dependency of androidcore and rosjavacore in my project and updated the manifest. I wanted to execute the pub_sub tutorial code in my newly created project. All works fine, the code compile with no problem.

However, when I upload the code to the mobile phone, I always get an Exception as follows:

03-13 23:55:05.658 25522-25522/app.mybot.org.mybot E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: app.mybot.org.mybot, PID: 25522 java.lang.RuntimeException: Unable to start activity ComponentInfo{app.mybot.org.mybot/org.ros.android.MasterChooser}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2447) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2507) at android.app.ActivityThread.access$900(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5692) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at org.ros.android.MasterChooser.onCreate(MasterChooser.java:78) at android.app.Activity.performCreate(Activity.java:5541) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2411)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2507)             at android.app.ActivityThread.access$900(ActivityThread.java:172)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:146)             at android.app.ActivityThread.main(ActivityThread.java:5692)             at java.lang.reflect.Method.invokeNative(Native Method)             at java.lang.reflect.Method.invoke(Method.java:515)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)             at dalvik.system.NativeStart.main(Native Method) 03-13 23:55:08.333 25522-25522/app.mybot.org.mybot I/Process﹕ Sending signal. PID: 25522 SIG: 9

I do not know why MasterChooser always java.lang.NullPointerException. The same code work fine in a project that I created inside androidcore folder itself. But it does not execute on the folder of my project that is outside androidcore folder, although I imported all dependencies and also the code compiles fine with no problem.

Any help will be appreciated Anis

Asked by Anis on 2015-03-13 16:06:24 UTC

Comments

Answers

Hey, have you ever found out a solution to this problem? I'm facing the same issue here

Asked by ielson on 2020-01-20 13:47:21 UTC

Comments