我已經很好地搜索了這個話題,並且一直無法找到一個好的解決方案。以下是我的清單和Google開發者控制檯的錯誤代碼。我在400-500次下載中每週得到大約3-4次「報告」崩潰。我對Android開發相當陌生,希望你們中的一位能指出我的錯誤!也許這是事實,我的「主要類」和我的包名稱是相同的,但它似乎是一個隨機崩潰的奇怪。提前致謝!!類未找到異常「java.lang.ClassNotFoundException」Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.matt.android.adds.freeHistory"
android:installLocation="preferExternal"
android:versionName="4.11" android:versionCode="15">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE">
</uses-permission>
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="false" />
<application android:icon="@drawable/flag" android:label="@string/app_name">
<activity android:name=".freeHistory"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".dateClass"></activity>
<activity android:name=".presClass"></activity>
<activity android:name=".presInfo"></activity>
<activity android:name=".flagClass"></activity>
<activity android:name=".flagInfo"></activity>
<activity android:name=".starSpangledBanner"></activity>
<activity android:name=".pledge"></activity>
<activity android:name=".impDocs"></activity>
<activity android:name=".viewDoc"></activity>
<activity android:name=".articlesOTC"></activity>
<activity android:name=".viewArticleOTC"></activity>
<activity android:name=".constitution"></activity>
<activity android:name=".preamble"></activity>
<activity android:name=".consArtOne"></activity>
<activity android:name=".displayConsArticle"></activity>
<activity android:name=".billOfRightsView"></activity>
<activity android:name=".billOfRights"></activity>
<activity android:name=".randomFact"></activity>
<activity android:name=".amendView"></activity>
<activity android:name=".amendClass"></activity>
<activity android:name=".stateInfo"></activity>
<activity android:name=".theStates"></activity>
<activity android:name="com.mobfox.sdk.InAppWebView"/>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboardHidden|orientation"/>
</application>
</manifest>
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.matt.android.adds.freeHistory/com.matt.android.adds.freeHistory.freeHisto ry}: java.lang.ClassNotFoundException: com.matt.android.adds.freeHistory.freeHistory in loader dalvik.system.PathClassLoader[/mnt/asec/com.matt.android.adds.freeHistory-1/pkg.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
at android.app.ActivityThread.access$1500(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.matt.android.adds.freeHistory.freeHistory in loader dalvik.system.PathClassLoader[/mnt /asec/com.matt.android.adds.freeHistory-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
... 11 more
是com.matt.android.adds.freeHistory包中的freeHistory類嗎? – sampathpremarathna 2011-12-19 05:27:25
@ sampathpremarathna是的,freeHistory類是在那個包中 – James 2011-12-19 05:28:30
是否有可能只有那些從你以前的版本升級的用戶纔會崩潰? – 2011-12-19 05:43:29