Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 不幸的是(应用程序)已停止android开发者错误_Java_Android_Bluetooth - Fatal编程技术网

Java 不幸的是(应用程序)已停止android开发者错误

Java 不幸的是(应用程序)已停止android开发者错误,java,android,bluetooth,Java,Android,Bluetooth,当我尝试在android手机上运行我的应用程序时,我收到一个“不幸(应用程序)已停止”错误。该应用程序应该提供一个简单的接口,通过蓝牙模块控制arduino。下面是我的Logcat。请提供有关此错误的帮助,我是第一次使用eclipse的用户,因此尽可能多的详细信息将非常有用 04-12 14:14:54.848: D/AndroidRuntime(20026): Shutting down VM 04-12 14:14:54.848: W/dalvikvm(20026): threadid=1:

当我尝试在android手机上运行我的应用程序时,我收到一个“不幸(应用程序)已停止”错误。该应用程序应该提供一个简单的接口,通过蓝牙模块控制arduino。下面是我的Logcat。请提供有关此错误的帮助,我是第一次使用eclipse的用户,因此尽可能多的详细信息将非常有用

04-12 14:14:54.848: D/AndroidRuntime(20026): Shutting down VM
04-12 14:14:54.848: W/dalvikvm(20026): threadid=1: thread exiting with uncaught  exception (group=0x415a9b90)
04-12 14:14:54.858: E/AndroidRuntime(20026): FATAL EXCEPTION: main
04-12 14:14:54.858: E/AndroidRuntime(20026): Process: com.example.fridgeshoot, PID: 20026
04-12 14:14:54.858: E/AndroidRuntime(20026): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fridgeshoot/com.example.fridgeshoot.MainActivity}: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread.access$700(ActivityThread.java:135)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.os.Handler.dispatchMessage(Handler.java:102)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.os.Looper.loop(Looper.java:137)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread.main(ActivityThread.java:4998)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at java.lang.reflect.Method.invokeNative(Native Method)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at java.lang.reflect.Method.invoke(Method.java:515)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at dalvik.system.NativeStart.main(Native Method)
04-12 14:14:54.858: E/AndroidRuntime(20026): Caused by: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.
04-12 14:14:54.858: E/AndroidRuntime(20026):    at    android.os.Parcel.readException(Parcel.java:1461)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.os.Parcel.readException(Parcel.java:1415)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.bluetooth.IBluetooth$Stub$Proxy.isEnabled(IBluetooth.java:575)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:452)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at com.example.fridgeshoot.MainActivity.checkBTState(MainActivity.java:180)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at com.example.fridgeshoot.MainActivity.onCreate(MainActivity.java:53)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.Activity.performCreate(Activity.java:5243)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-12 14:14:54.858: E/AndroidRuntime(20026):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
04-12 14:14:54.858: E/AndroidRuntime(20026):    ... 11 more
04-12 14:21:20.479: D/AndroidRuntime(20303): Shutting down VM
04-12 14:21:20.479: W/dalvikvm(20303): threadid=1: thread exiting with uncaught exception (group=0x415a9b90)
04-12 14:21:20.479: E/AndroidRuntime(20303): FATAL EXCEPTION: main
04-12 14:21:20.479: E/AndroidRuntime(20303): Process: com.example.fridgeshoot, PID: 20303
04-12 14:21:20.479: E/AndroidRuntime(20303): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fridgeshoot/com.example.fridgeshoot.MainActivity}: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread.access$700(ActivityThread.java:135)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.os.Handler.dispatchMessage(Handler.java:102)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.os.Looper.loop(Looper.java:137)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread.main(ActivityThread.java:4998)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at java.lang.reflect.Method.invokeNative(Native Method)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at java.lang.reflect.Method.invoke(Method.java:515)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at dalvik.system.NativeStart.main(Native Method)
04-12 14:21:20.479: E/AndroidRuntime(20303): Caused by: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.os.Parcel.readException(Parcel.java:1461)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.os.Parcel.readException(Parcel.java:1415)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.bluetooth.IBluetooth$Stub$Proxy.isEnabled(IBluetooth.java:575)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:452)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at com.example.fridgeshoot.MainActivity.checkBTState(MainActivity.java:180)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at com.example.fridgeshoot.MainActivity.onCreate(MainActivity.java:53)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.Activity.performCreate(Activity.java:5243)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-12 14:21:20.479: E/AndroidRuntime(20303):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
04-12 14:21:20.479: E/AndroidRuntime(20303):    ... 11 more
04-12 14:21:20.489: I/Process(20303): Sending signal. PID: 20303 SIG: 9
04-12 14:30:39.706: W/ActivityThread(20973): Application com.example.fridgeshoot is waiting for the debugger on port 8100...
04-12 14:30:39.716: I/System.out(20973): Sending WAIT chunk
04-12 14:30:39.916: I/dalvikvm(20973): Debugger is active
04-12 14:30:39.916: I/System.out(20973): Debugger has connected
04-12 14:30:39.926: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:40.127: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:40.327: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:40.527: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:40.727: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:40.928: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:41.128: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:41.338: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:41.538: I/System.out(20973): waiting for debugger to settle...
04-12 14:30:41.738: I/System.out(20973): debugger has settled (1447)
04-12 14:30:42.669: D/dalvikvm(20973): threadid=1: still suspended after undo (sc=1 dc=1)

错误消息非常具体:

Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.

您需要在应用程序的清单中声明该权限。

错误消息非常具体:

Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.

您需要在应用程序的清单中声明该权限。

错误消息非常具体:

Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.

您需要在应用程序的清单中声明该权限。

错误消息非常具体:

Need BLUETOOTH permission: Neither user 10117 nor current process has android.permission.BLUETOOTH.

您需要在应用程序的清单中声明该权限。

正如前面提到的chrylis一样,错误消息不言自明:
需要蓝牙权限

您的AndroidManifest.xml应该如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.appname" >

<uses-permission android:name="android.permission.BLUETOOTH"/>
<application
    <<<there goes the rest of manifest>>>


正如前面提到的chrylis一样,错误消息不言自明:
需要蓝牙权限

您的AndroidManifest.xml应该如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.appname" >

<uses-permission android:name="android.permission.BLUETOOTH"/>
<application
    <<<there goes the rest of manifest>>>


正如前面提到的chrylis一样,错误消息不言自明:
需要蓝牙权限

您的AndroidManifest.xml应该如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.appname" >

<uses-permission android:name="android.permission.BLUETOOTH"/>
<application
    <<<there goes the rest of manifest>>>


正如前面提到的chrylis一样,错误消息不言自明:
需要蓝牙权限

您的AndroidManifest.xml应该如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.appname" >

<uses-permission android:name="android.permission.BLUETOOTH"/>
<application
    <<<there goes the rest of manifest>>>


也许你的代码会有点帮助?邮递it@PrashantPatel代码通常很有用,但在这种情况下,错误消息就足够了。您的代码可能会有所帮助吗?邮递it@PrashantPatel代码通常很有用,但在这种情况下,错误消息就足够了。您的代码可能会有所帮助吗?邮递it@PrashantPatel代码通常很有用,但在这种情况下,错误消息就足够了。您的代码可能会有所帮助吗?邮递it@PrashantPatel代码通常很有用,但在这种情况下,错误消息就足够了。