ERROR:
08-21 00:08:53.544: D/AndroidRuntime(31470): Shutting down VM
08-21 00:08:53.544: W/dalvikvm(31470): threadid=1: thread exiting with uncaught exception (group=0x4001b6a8)
08-21 00:08:53.549: E/AndroidRuntime(31470): FATAL EXCEPTION: main
08-21 00:08:53.549: E/AndroidRuntime(31470): java.lang.RuntimeException: Unable to instantiate application com.sg.js.OldMaid.OldMaid: java.lang.ClassNotFoundException: com.sg.js.OldMaid.OldMaid in loader
dalvik.system.PathClassLoader[/mnt/asec/com.sg.js.OldMaid-1/pkg.apk]
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.app.LoadedApk.makeApplication(LoadedApk.java:497)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3362)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.app.ActivityThread.access$2200(ActivityThread.java:155)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1037)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.os.Handler.dispatchMessage(Handler.java:130)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.os.Looper.loop(SourceFile:351)
08-21 00:08:53.549: E/AndroidRuntime(31470): at android.app.ActivityThread.main(ActivityThread.java:3820)
08-21 00:08:53.549: E/AndroidRuntime(31470): at java.lang.reflect.Method.invokeNative(Native Method)
08-21 00:08:53.549: E/AndroidRuntime(31470): at java.lang.reflect.Method.invoke(Method.java:538)
一旦我运行应用程序..它会自动强制关闭,即使我已经检查了我的清单文件..但也许我需要其他眼睛才能看到我的错误
代码:
<?xml version="1.0" encoding="Utf-8"?>
<manifest android:versionCode="4" android:versionName="1.0.4" package="com.sg.js.OldMaid"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/icon"
android:name=".OldMaid"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity
android:label="@string/app_name"
android:name=".OldMaid"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode ">
<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" />
</application>
</manifest>
这是我的Manifest.xml ..检查是否有错误。
答案 0 :(得分:1)
您似乎在package =“...”属性中有类名。尝试从该属性的末尾删除“.OldMaid”。
答案 1 :(得分:0)
在我的情况下,问题出现在我的模块的gradle配置中!
它包含一个名为 applicationId
的字段,其中包含包的字符串值。这显然包含旧的包装名称!
我解决了这个问题,在同步后,一切正常!