之前已经提出过这个问题但是我已经完成了我发现的故障排除步骤,但是它没有工作。
这是我在控制台中看到的消息。它与平时不同。最后一部分cmp = com.quincy.androidbletest / .MonitoringActivity 看起来不对。
[2014-10-10 17:34:49 - AndroidBLETest] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.quincy.androidbletest/.MonitoringActivity }
然后当我的应用程序打开时,我发现它已经停止了#34;在电话上,我收到此错误:
10-10 17:35:00.833: E/AndroidRuntime(30092): java.lang.RuntimeException: Unable to instantiate application com.quincy.androidbletest.AndroidBLETest: java.lang.ClassNotFoundException: Didn't find class "com.quincy.androidbletest.AndroidBLETest" on path: DexPathList[[zip file "/data/app/com.quincy.androidbletest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.quincy.androidbletest-2, /vendor/lib, /system/lib]]
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4382)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.ActivityThread.access$1500(ActivityThread.java:139)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.os.Handler.dispatchMessage(Handler.java:102)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.os.Looper.loop(Looper.java:136)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.ActivityThread.main(ActivityThread.java:5086)
10-10 17:35:00.833: E/AndroidRuntime(30092): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 17:35:00.833: E/AndroidRuntime(30092): at java.lang.reflect.Method.invoke(Method.java:515)
10-10 17:35:00.833: E/AndroidRuntime(30092): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
10-10 17:35:00.833: E/AndroidRuntime(30092): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
10-10 17:35:00.833: E/AndroidRuntime(30092): at dalvik.system.NativeStart.main(Native Method)
10-10 17:35:00.833: E/AndroidRuntime(30092): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.quincy.androidbletest.AndroidBLETest" on path: DexPathList[[zip file "/data/app/com.quincy.androidbletest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.quincy.androidbletest-2, /vendor/lib, /system/lib]]
10-10 17:35:00.833: E/AndroidRuntime(30092): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
10-10 17:35:00.833: E/AndroidRuntime(30092): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
10-10 17:35:00.833: E/AndroidRuntime(30092): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.Instrumentation.newApplication(Instrumentation.java:998)
10-10 17:35:00.833: E/AndroidRuntime(30092): at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
10-10 17:35:00.833: E/AndroidRuntime(30092): ... 11 more
我的manifest.xml看起来完美无瑕:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quincy.androidbletest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="AndroidBLETest">
<activity
android:name="com.quincy.androidbletest.MonitoringActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.quincy.androidbletest.RangingActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
<activity
android:name="com.quincy.androidbletest.BackgroundActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
感谢任何帮助。这么多问题让我们长时间工作。
答案 0 :(得分:0)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="AndroidBLETest">
<activity
android:name="com.quincy.androidbletest.MonitoringActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.quincy.androidbletest.RangingActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.quincy.androidbletest.BackgroundActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
答案 1 :(得分:0)
我通过切换到Android Studio解决了我的问题。然后使用gradle 1.10我能够构建我的应用程序并成功运行。