2016-04-17 112 views
0

我試圖從android studio 2修改這個項目,但是當我嘗試從Android 4.4.2運行應用程序並連接到藍牙設備時,它會給出這些錯誤消息。Sensortag20程序崩潰連接到藍牙設備

06-02 14:51:30.126 12669-12669/com.example.ti.ble.sensortag E/AndroidRuntime: FATAL EXCEPTION: main 
Process: com.example.ti.ble.sensortag, PID: 12669 
java.lang.IllegalArgumentException: null is not a valid Bluetooth address 
at android.bluetooth.BluetoothDevice.<init>(BluetoothDevice.java:564) 
at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:418) 
at com.example.ti.ble.common.BluetoothLeService.disconnect(BluetoothLeService.java:635) 
at com.example.ti.ble.sensortag.MainActivity.onConnect(MainActivity.java:320) 
at com.example.ti.ble.sensortag.MainActivity.onDeviceClick(MainActivity.java:379) 
at com.example.ti.ble.sensortag.ScanView$1.onItemClick(ScanView.java:205) 
at android.widget.AdapterView.performItemClick(AdapterView.java:299) 
at android.widget.AbsListView.performItemClick(AbsListView.java:1152) 
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3014) 
at android.widget.AbsListView$3.run(AbsListView.java:3865) 
at android.os.Handler.handleCallback(Handler.java:808) 
at android.os.Handler.dispatchMessage(Handler.java:103) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:5341) 
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:825) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) 
at dalvik.system.NativeStart.main(Native Method) 

該項目可以在這裏找到SensorTag20 Project。我如何解決這些問題?

+0

SensorTag使用Android 4.2不支持的藍牙LE。 –

+0

對不起我的錯誤,只是意識到我的設備實際上是運行Android 4.4.2。現在會改變。 –

回答

0

原來,我只是需要重新啓動設備,每次我重新編程它。