在android 4.0.4中安装应用程序时出现解析错误

时间:2012-04-12 05:11:57

标签: android

04-12 09:41:33.425: W/PackageInstaller(5015): Parse error when parsing manifest. Discontinuing installation
04-12 09:41:33.425: W/PackageParser(5015): Unable to read AndroidManifest.xml of /mnt/sdcard/Download/downloadfile.apk
04-12 09:41:33.425: W/PackageParser(5015): java.io.FileNotFoundException: AndroidManifest.xml
04-12 09:41:33.425: W/PackageParser(5015):  at android.content.res.AssetManager.openXmlAssetNative(Native Method)
04-12 09:41:33.425: W/PackageParser(5015):  at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:487)
04-12 09:41:33.425: W/PackageParser(5015):  at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:455)
04-12 09:41:33.425: W/PackageParser(5015):  at android.content.pm.PackageParser.parsePackage(PackageParser.java:425)
04-12 09:41:33.425: W/PackageParser(5015):  at com.android.packageinstaller.PackageUtil.getPackageInfo(PackageUtil.java:74)
04-12 09:41:33.425: W/PackageParser(5015):  at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java:277)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.Activity.performCreate(Activity.java:4465)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-12 09:41:33.425: W/PackageParser(5015):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 09:41:33.425: W/PackageParser(5015):  at android.os.Looper.loop(Looper.java:137)
04-12 09:41:33.425: W/PackageParser(5015):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-12 09:41:33.425: W/PackageParser(5015):  at java.lang.reflect.Method.invokeNative(Native Method)
04-12 09:41:33.425: W/PackageParser(5015):  at java.lang.reflect.Method.invoke(Method.java:511)
04-12 09:41:33.425: W/PackageParser(5015):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-12 09:41:33.425: W/PackageParser(5015):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-12 09:41:33.425: W/PackageParser(5015):  at dalvik.system.NativeStart.main(Native Method)

请问如何解决此问题。

3 个答案:

答案 0 :(得分:0)

尝试使用eclipse右键单击项目 - > android工具 - >修复项目属性 然后清理并构建。

答案 1 :(得分:0)

您可以检查包文件以查看Manifest.xml文件是否在其中并包含您放入其中的信息。可以使用大多数zip实用程序打开.apk文件。请参阅以下格式的以下链接:apk file format on Wikipedea

如果没有看到manifest.xml文件,就很难再说了。

答案 2 :(得分:0)

我在这个错误上花了一些时间,发现有两种可能性。

  1. 您的apk无法正常构建(尝试从设备或模拟器清除项目/卸载并再次尝试构建)。
  2. 如果您已在某些服务器上上传了apk,则上传已损坏。