问题描述
10-22 15:29:40.897: E/AndroidRuntime(2561): FATAL EXCEPTION: main
10-22 15:29:40.897: E/AndroidRuntime(2561): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gvg.simid/com.gvg.simid.Login}: java.lang.ClassNotFoundException: Didn't find class "com.gvg.simid.Login" on path: DexPathList[[zip file "/data/app/com.gvg.simid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gvg.simid-1, /vendor/lib, /system/lib]]
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.os.Looper.loop(Looper.java:137)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread.main(ActivityThread.java:5103)
10-22 15:29:40.897: E/AndroidRuntime(2561): at java.lang.reflect.Method.invokeNative(Native Method)
10-22 15:29:40.897: E/AndroidRuntime(2561): at java.lang.reflect.Method.invoke(Method.java:525)
10-22 15:29:40.897: E/AndroidRuntime(2561): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-22 15:29:40.897: E/AndroidRuntime(2561): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-22 15:29:40.897: E/AndroidRuntime(2561): at dalvik.system.NativeStart.main(Native Method)
10-22 15:29:40.897: E/AndroidRuntime(2561): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gvg.simid.Login" on path: DexPathList[[zip file "/data/app/com.gvg.simid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gvg.simid-1, /vendor/lib, /system/lib]]
10-22 15:29:40.897: E/AndroidRuntime(2561): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
10-22 15:29:40.897: E/AndroidRuntime(2561): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-22 15:29:40.897: E/AndroidRuntime(2561): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
10-22 15:29:40.897: E/AndroidRuntime(2561): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
10-22 15:29:40.897: E/AndroidRuntime(2561): ... 11 more
我真的不知道是什么原因造成它,因为它是在清单中正确列出:
I'm not really sure what is causing it as it is correctly listed in the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gvg.simid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_OWNER_DATA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_OWNER_DATA" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.usb.host" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.gvg.simid.Login"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我还补充说:Android的私人图书馆建设的路径,并把它移到排序和导出的顶部,但它仍然给了我同样的错误。
I also added "Android Private Libraries" to build path, and moved it to the top of "Order and Export", but it still gave me the same error.
编辑:我完全重建项目,并且无法重现错误。不知道是什么导致它。
I rebuilt the project completely, and was unable to reproduce the error. Not sure what was causing it.
推荐答案
我有同样的问题,我project.It发生是由于我的项目和库项目的支持Android库的版本,我加在我的项目冲突。 把同一版本的Android支持库中的项目和库项目,包括你和干净的构建 ...一切都将工作...
I had the same issue for my project.It happened due to the conflict in android support library version between my project and the library project that i added in my project. Put the same version android support library in your project and library projects you included and clean build... Everything will work...
这篇关于Android的ClassNotFoundException的:没有找到路径类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!