2013-06-03 44 views
3

我得到消息來探索http://code.google.com/p/iosched/。我沒有改變任何清單或代碼,所以:Ioshed 2012 HomeActivity.class not found

<manifest 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="com.google.android.apps.iosched" 

    .... 

    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/> 

    .... 

    <activity 
     android:name=".ui.HomeActivity" 
     android:label="@string/app_name" 
     android:theme="@style/Theme.Iosched.Home"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

我構建了項目並安裝在幾個設備(gb,icm)上。當啓動時,它說:

06-03 14:51:40.457:E/AndroidRuntime(1442):致命異常:主要 06-03 14:51:40.457:E/AndroidRuntime(1442): 的java java.lang.ClassNotFoundException: com.google.android .apps.iosched.ui.HomeActivity 06-03 14:51:40.457: E/AndroidRuntime(1442):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983) 06-03 14:51:40.457 :E/AndroidRuntime(1442):在 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 06-03 14:51:40.457:E/AndroidRuntime(1442):at android.app.ActivityThread.access $ 600(ActivityThread.java:130)06 -03 14:51:40.457:E/AndroidRuntime(1442):at android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1195) 06-03 14:51:40.457:E/AndroidRuntime(1442) :at android.os.Handler.dispatchMessage(Handler.java:99)06-03 14:51:40.457:E/AndroidRuntime(1442):at android.os.Looper.loop(Looper.java:137) 06-03 14:51:40.457: E/AndroidRuntime(1442):at android.app.ActivityThread.main(ActivityThread.java:4745)06-03 14:51:40.457:E/AndroidRuntime(1442):在 java.lang.reflect.Method.invokeNative(Native Method)06-03 14:51:40.457:E/AndroidRuntime(1442):at java.lang.reflect.Method.invoke(Method.java:511)06 -03 14:51:40.457: E/AndroidRuntime(1442):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:786) 06-03 14:51:40.457:E/AndroidRuntime(1442):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)06-03 14:51:40.457:E/AndroidRuntime(1442):at dalvik.system.NativeStart。 main(Native Method)06-03 14:51:40.457: E/AndroidRuntime(1442):導致:java.lang.ClassNotFoundException: com.google.android.apps.iosched.ui.HomeActivity 06-03 14: 51:40.457: E/AndroidRuntime(1442):at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 06-03 14:51:40.457:E/AndroidRuntime(1442):at java.lang.ClassLoader.loadClass (ClassLoader.java:501)06-03 14:51:40.457:E/AndroidRuntime(1442):at java.lang.ClassLoader.loadClass(ClassLoader.java:461)06-03 14:51:40.457: E/AndroidRuntime(1442):at android.app.Instrumentation.newActivity(Instrumentation.java:1053) 06-03 14:51:40.457:E/AndroidRuntime(1442):at android.app.ActivityThread.performLaunchActivity( ActivityThread.java:1974) 06-03 14:51:40.457:E/AndroidRuntime(1442):... 11更多

「java.lang.ClassNotFoundException:com.google.android.apps.iosched.ui.HomeActivity」自從類存在以後,這似乎很奇怪。

你能提出什麼建議嗎?

ps我試圖清理和修復屬性,但徒勞。

回答

4

我收到相同類型的與Eclipse的問題,這是因爲我沒有選擇出口的兼容包。 Eclipse -> Right click on project -> Properties -> Java Build Path -> Order & Export -> Make sure "Private Libraries" are checked

這個想法是,活動是沒有問題的,問題是FragmentActivity不存在於最終的apk文件中。

1
<activity 
     android:name=".HomeActivity" 
     android:label="@string/app_name" 
     android:theme="@style/Theme.Iosched.Home"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
</activity> 

如果不工作,那麼使用這個

<activity 
     android:name="com.google.android.apps.iosched.HomeActivity" 
     android:label="@string/app_name" 
     android:theme="@style/Theme.Iosched.Home"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
</activity>