雖然我正在測試我的應用程序的調試版本 - 沒關係。之後我簽字的谷歌播放版本 - 它開始與FC以下異常:ClassNotFoundException對簽署apk後的活動
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.wiagames.guitartuner/com.wiagames.guitartuner.activities.MainActivity}: java.lang.ClassNotFoundException: com.wiagames.guitartuner.activities.MainActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.wiagames.guitartuner.activities.MainActivity
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
清單:
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher">
<activity android:name=".activities.MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
如何解決呢?
它可能會導致你的活動被混淆得太嚴重了嗎? – harism
在導出APK之前,我沒有選中「運行proguard」。 – arts777
你可以隨時解壓你的apk和dex2jar它,並檢查是否有一切。 – dmon