1

我最近得到了一些应用程序源代码。所以我导入了 Eclipse 并重命名了应用程序包。一切都很顺利,直到我尝试启动该应用程序。当我这样做时,它会立即崩溃。我想知道为什么。这是日志:

E/ActivityManager(  215): heap conf. property name string trimmed: hs.com.shadycorp.MoonStoneMarbl
E/AndroidRuntime( 5644): FATAL EXCEPTION: main
E/AndroidRuntime( 5644): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.shadycorp.MoonStoneMarble/theHardestGame.pac.GameLogicController}: java.lang.ClassNotFoundException: theHardestGame.pac.GameLogicController in loader dalvik.system.PathClassLoader[/data/app/com.shadycorp.MoonStoneMarble-1.apk]
E/AndroidRuntime( 5644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1580)
E/AndroidRuntime( 5644): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
E/AndroidRuntime( 5644): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 5644): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
E/AndroidRuntime( 5644): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5644): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 5644): at android.app.ActivityThread.main(ActivityThread.java:3735)
E/AndroidRuntime( 5644): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5644): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 5644): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime( 5644): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
E/AndroidRuntime( 5644): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 5644): Caused by: java.lang.ClassNotFoundException: theHardestGame.pac.GameLogicController in loader dalvik.system.PathClassLoader[/data/app/com.shadycorp.MoonStoneMarble-1.apk]
E/AndroidRuntime( 5644): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
E/AndroidRuntime( 5644): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
E/AndroidRuntime( 5644): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 5644): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 5644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1572)
E/AndroidRuntime( 5644): ... 11 more
E/AndroidRuntime( 5644): [Blue Error Handler] Make Debugging Report file for main
E/AndroidRuntime( 5644): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.shadycorp.MoonStoneMarble/theHardestGame.pac.GameLogicController}: java.lang.ClassNotFoundException: theHardestGame.pac.GameLogicController in loader dalvik.system.PathClassLoader[/data/app/com.shadycorp.MoonStoneMarble-1.apk]
E/AndroidRuntime( 5644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1580)
E/AndroidRuntime( 5644): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
E/AndroidRuntime( 5644): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 5644): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
E/AndroidRuntime( 5644): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5644): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 5644): at android.app.ActivityThread.main(ActivityThread.java:3735)
E/AndroidRuntime( 5644): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5644): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 5644): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime( 5644): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
E/AndroidRuntime( 5644): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 5644): Caused by: java.lang.ClassNotFoundException: theHardestGame.pac.GameLogicController in loader dalvik.system.PathClassLoader[/data/app/com.shadycorp.MoonStoneMarble-1.apk]
E/AndroidRuntime( 5644): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
E/AndroidRuntime( 5644): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
E/AndroidRuntime( 5644): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 5644): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 5644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1572)

这是我的安卓清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="theHardestGame.pac"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="4" />

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".GameLogicController"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
4

2 回答 2

0

Looks like you've not updated the package consistently. In your manifest it's "theHardestGame.pac", while the application package seems to be "com.shadycorp.MoonStoneMarble". I suggest you search for those strings and make sure you've updated everything. Also make sure you're doing a clean build.

于 2012-12-28T16:51:15.297 回答
0

检查 AndroidManifest.xml 中的默认操作。它可能设置为 theHardestGame.pac.GameLogicController 并且应该是别的东西。

于 2012-12-28T14:20:23.800 回答