2

I have a big issue with a project i'm working on. It's a project that use bluetooth to communicate with an arduino, the app have to detect color on an object.

I don't have an android phone so I'm using the emulator ( Nexus5_API_23 ), but when i'm trying to launch the app i getting an error message and what's following in the android Monitor. Do you guys have any idea on what can be the problem ?

PS : I know that emulator can't simulate bluetooth, but is it really the problem here ?

05-10 15:47:08.185 2767-2767/com.example.caroline.colorfinder I/art: Not late-enabling -Xcheck:jni (already on)
05-10 15:47:08.403 2767-2767/com.example.caroline.colorfinder D/CameraBridge: Attr count: 3
05-10 15:47:08.410 2767-2767/com.example.caroline.colorfinder E/BluetoothAdapter: Bluetooth binder is null
05-10 15:47:08.410 2767-2767/com.example.caroline.colorfinder D/OCVSample::Activity: Sorry, No Bluetooth antenna found!
05-10 15:47:08.410 2767-2767/com.example.caroline.colorfinder D/AndroidRuntime: Shutting down VM
05-10 15:47:08.410 2767-2767/com.example.caroline.colorfinder E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            Process: com.example.caroline.colorfinder, PID: 2767
                                                                            java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.caroline.colorfinder/com.example.caroline.colorfinder.ColorFinderActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothAdapter.isEnabled()' on a null object reference
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                at android.os.Looper.loop(Looper.java:148)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                             Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothAdapter.isEnabled()' on a null object reference
                                                                                at com.example.caroline.colorfinder.ColorFinderActivity.onCreate(ColorFinderActivity.java:133)
                                                                                at android.app.Activity.performCreate(Activity.java:6237)
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.jav    a:726) 
                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Zoe
  • 27,060
  • 21
  • 118
  • 148

0 Answers0