App Crash不断java.lang.ClassNotFoundException

时间:2015-05-11 11:16:36

标签: android classnotfoundexception

Senerio就像这样,我的带有Version.1的应用程序出现在 priv-app 文件夹中,它运行正常,现在我用新的Version.2更新它。应用程序从 LauncherActivity.java 开始,无故障运行。在我的程序中某处发生了 NullPointerException 崩溃,然后App退出,当我尝试打开它时开始崩溃。 我正在使用外部库并检查Order和Export中的所有库 PackageName是 com.example 这是LOG -

 FATAL EXCEPTION: main
 Process: com.example, PID: 7473
 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example/com.example.LauncherActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.LauncherActivity" on path: DexPathList[[zip file "/system/priv-app/APP.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-1, /vendor/lib, /system/lib]]
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2264)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    at android.app.ActivityThread.access$800(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5292)
    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:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.LauncherActivity" on path: DexPathList[[zip file "/system/priv-app/APP.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-1, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255)

的AndroidManifest.xml

<application
    android:name="com.example.AppApplication"
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/AppTheme"
    android:windowSoftInputMode="adjustResize">
    <activity
        android:name="com.example.LauncherActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

1 个答案:

答案 0 :(得分:0)

我认为应该是com.example.AppApplication.LauncherActivity

而不是 com.example.LauncherActivity  在清单中。