简体   繁体   中英

My android app keeps crashing when I launch it

I recently got some app source code. So I imported to Eclipse and renamed application package. It all went well until I tried launch the app. When I do it instantly crashes. I was wondering why. This is the log:

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)

this is my android manifest

<?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>

Check the default action in AndroidManifest.xml. It's probably set to theHardestGame.pac.GameLogicController and should be something else.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM