我发布了我的某个应用程序的新版本,当应用程序启动时,我开始收到大量有关崩溃问题的错误。
这些是我得到的错误:
第一个错误:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.jayColber.andcarryon/com.jayColber.andcarryon.MainActivity}: java.lang.ClassNotFoundException: com.jayColber.andcarryon.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.jayColber.andcarryon-1.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
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:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.jayColber.andcarryon.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.jayColber.andcarryon-1.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:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
... 11 more
第二个错误:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.jayColber.andcarryon/com.jayColber.andcarryon.MainActivity}: java.lang.ClassNotFoundException: com.jayColber.andcarryon.MainActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
at android.app.ActivityThread.access$600(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.jayColber.andcarryon.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:1039)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
... 11 more
我的AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jayColber.andcarryon"
android:versionCode="10"
android:versionName="1.1.3" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.dlauncher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.fede.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.lge.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="org.adw.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.motorola.dlauncher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.lge.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<application
android:icon="@drawable/icon144"
android:label="@string/app_name"
android:allowBackup="true"
android:largeHeap="true"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<activity android:name="MainActivity" android:label="Keep Calm" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="BackgroundSelector" android:label="Select Background" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="library.AmbilWarna" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="IconSelector" android:label="Select Icon" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="ShareSelector" android:label="Share your poster" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="colorSelector" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="infoActivity" android:label="Info" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="com.revmob.ads.fullscreen.FullscreenActivity" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></activity>
<activity android:name="com.apperhand.device.android.EULAActivity" android:theme="@android:style/Theme.Translucent" android:configChanges="keyboard|keyboardHidden|orientation" />
<service android:enabled="true" android:name="com.apperhand.device.android.AndroidSDKProvider"/>
<meta-data android:name="com.startapp.android.DEV_ID" android:value="1011042240"/>
<meta-data android:name="com.startapp.android.APP_ID" android:value="201812008"/>
</application>
</manifest>
我尝试使用APK文件&amp ;;在几个设备上安装应用程序TestFlight和它完美配合 - 但是当从Google Play安装到设备中时,它会立即崩溃。
答案 0 :(得分:0)
如果您没有为每个组件指定软件包名称,那么正确的速记就是以句点启动它。例如。而不是
<activity android:name="MainActivity" android:label="Keep Calm" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
它应该是:
<activity android:name=".MainActivity" android:label="Keep Calm" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
同样适用于所有其他组件。否则,您应指定包名称
<activity android:name="com.jayColber.andcarryon.MainActivity" android:label="Keep Calm" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">