Android:未找到主要活动

时间:2013-06-10 11:02:05

标签: android android-activity manifest

我的应用程序已经运行正常,但突然发现主要活动不再存在。不知道为什么。

最后我得到java.lang.ClassNotFoundException: de.xxx.android.shopper.MyShopperActivity

我使用Android SDK管理器进行了软件更新。之后我在这个特殊应用程序中收到错误,其他所有错误都没有受到影响。

我的清单          

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19"/> 

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:icon="@drawable/shoppericon2"
    android:allowBackup="true"
    android:label="@string/AppNameAppString" >

    <activity
        android:name=".MyShopperActivity"
        android:label="@string/AppNameActivityString" 
        android:screenOrientation="portrait"
        android:configChanges="orientation|keyboardHidden|screenSize">

       <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".MenuActivity" />
    <activity 
        android:name="com.google.ads.AdActivity" 
        android:label="@string/AppNameActivityString" 
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
        android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize" />

</application>

活动

package de.xxx.android.shopper;

import  ...
@SuppressLint("ParserError")
public class MyShopperActivity extends Activity implements AdListener
{
   ...
}

这就是logcat所说的:

06-10 10:45:57.464: D/AndroidRuntime(1518): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
06-10 10:45:57.474: D/AndroidRuntime(1518): CheckJNI is ON
06-10 10:45:58.133: D/AndroidRuntime(1518): Calling main entry com.android.commands.pm.Pm
06-10 10:45:58.193: D/AndroidRuntime(1518): Shutting down VM
06-10 10:45:58.203: D/dalvikvm(1518): GC_CONCURRENT freed 100K, 78% free 454K/2048K, paused 1ms+4ms
06-10 10:45:58.213: D/dalvikvm(1518): Debugger has detached; object registry had 1 entries
06-10 10:45:58.623: D/AndroidRuntime(1532): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
06-10 10:45:58.623: D/AndroidRuntime(1532): CheckJNI is ON
06-10 10:45:59.244: D/AndroidRuntime(1532): Calling main entry com.android.commands.am.Am
06-10 10:45:59.284: I/ActivityManager(863): Force stopping package de.xxx.android.shopper uid=10039
06-10 10:45:59.284: I/ActivityManager(863): Killing proc 1500:de.xxx.android.shopper/10039: force stop
06-10 10:45:59.284: W/ActivityManager(863): Force removing ActivityRecord{b5cbedc0 de.xxx.android.shopper/.MyShopperActivity}: app died, no saved state
06-10 10:45:59.304: W/NetworkManagementSocketTagger(863): setKernelCountSet(10039, 0) failed with errno -2
06-10 10:45:59.314: W/NetworkManagementSocketTagger(863): setKernelCountSet(10012, 1) failed with errno -2
06-10 10:45:59.334: I/ActivityManager(863): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.xxx.android.shopper/.MyShopperActivity} from pid 1532
06-10 10:45:59.384: D/AndroidRuntime(1532): Shutting down VM
06-10 10:45:59.414: D/dalvikvm(1532): GC_CONCURRENT freed 100K, 77% free 478K/2048K, paused 5ms+2ms
06-10 10:45:59.424: D/dalvikvm(1532): Debugger has detached; object registry had 1 entries
06-10 10:45:59.454: D/dalvikvm(1544): Not late-enabling CheckJNI (already on)
06-10 10:45:59.484: I/ActivityManager(863): Start proc de.xxx.android.shopper for activity de.xxx.android.shopper/.MyShopperActivity: pid=1544 uid=10039 gids={3003}
06-10 10:45:59.514: E/jdwp(1544): Failed writing handshake bytes: Broken pipe (-1 of 14)
06-10 10:45:59.514: D/dalvikvm(1544): Debugger has detached; object registry had 0 entries
06-10 10:45:59.554: W/NetworkManagementSocketTagger(863): setKernelCountSet(10039, 1) failed with errno -2
06-10 10:45:59.575: W/ActivityThread(1544): Application de.xxx.android.shopper is waiting for the debugger on port 8100...
06-10 10:45:59.575: I/System.out(1544): Sending WAIT chunk
06-10 10:46:00.307: I/dalvikvm(1544): Debugger is active
06-10 10:46:00.431: I/System.out(1544): Debugger has connected
06-10 10:46:00.431: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:00.641: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:00.778: W/ActivityManager(863): Launch timeout has expired, giving up wake lock!
06-10 10:46:00.850: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:01.055: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:01.267: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:01.482: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:01.688: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:01.897: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:02.103: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:02.321: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:02.535: I/System.out(1544): waiting for debugger to settle...
06-10 10:46:02.740: I/System.out(1544): debugger has settled (1314)
06-10 10:46:02.894: I/dalvikvm(1544): Failed resolving Lde/xxx/android/shopper/MyShopperActivity; interface 58 'Lcom/google/ads/AdListener;'
06-10 10:46:02.894: W/dalvikvm(1544): Link of class 'Lde/xxx/android/shopper/MyShopperActivity;' failed
06-10 10:46:04.593: W/NetworkManagementSocketTagger(863): setKernelCountSet(10012, 0) failed with errno -2
06-10 10:46:09.561: W/ActivityManager(863): Activity idle timeout for ActivityRecord{b5af65b8 de.xxx.android.shopper/.MyShopperActivity}

1 个答案:

答案 0 :(得分:0)

您好我认为您在manifestS中记下的父包和MyShopperActivity类的包名是不同的。我希望这就是问题。