无法安装APK

发布于 2024-11-06 04:06:54 字数 3049 浏览 0 评论 0原文

我使用带有 ADT 10.0 插件和 Android3.0 SDK 的 Eclipse Ganymede 来构建我的应用程序。

当我尝试在手机上部署应用程序时,我的控制台上写有以下内容:

[2011-05-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-05-06 10:35:38 - MyProject] (null)
[2011-05-06 10:35:38 - MyProject] Launch canceled! 

并且以下内容写入 adb logcat

INFO/zipro(2499): Could not find end-of-central-directory in Zip
DEBUG/asset(2499): failed to open Zip archive '/data/local/tmp/MyProject.apk'
WARN/PackageParser(2499): Unable to read AndroidManifest.xml of /data/local/tmp/MyProject.apk
WARN/PackageParser(2499): java.io.FileNotFoundException: AndroidManifest.xml
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:523)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:491)
WARN/PackageParser(2499):     at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:597)
WARN/PackageParser(2499):     at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:126)
WARN/PackageParser(2499):     at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:100)
WARN/PackageParser(2499):     at android.os.Binder.execTransact(Binder.java:288)
WARN/PackageParser(2499):     at dalvik.system.NativeStart.run(Native Method)
ERROR/PackageManager(1579): Failed to handle start copy. Giving up
ERROR/PackageManager(1579): java.lang.NullPointerException
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1253)
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1235)
ERROR/PackageManager(1579):     at com.android.internal.app.IMediaContainerService$Stub$Proxy.getMinimalPackageInfo(IMediaContainerService.java:220)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$InstallParams.handleStartCopy(PackageManagerService.java:5065)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$HandlerParams.startCopy(PackageManagerService.java:4954)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:476)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:421)
ERROR/PackageManager(1579):     at android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/PackageManager(1579):     at android.os.Looper.loop(Looper.java:143)
ERROR/PackageManager(1579):     at android.os.HandlerThread.run(HandlerThread.java:60)

当我尝试使用 adb shell 安装它时> 从 cmd 提示符中我得到:

EOCD not found, not Zip
file 'D:\Workspace\MyProject\bin\MyProject.apk' is not a valid zip file

我已尝试清理项目/删除 gen 文件夹/删除调试密钥库。没有任何效果;

请指教。

I am using Eclipse Ganymede with ADT 10.0 plugin and Android3.0 SDK to build my application.

When i try to deploy the application on my phone I get the following written on my console:

[2011-05-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-05-06 10:35:38 - MyProject] (null)
[2011-05-06 10:35:38 - MyProject] Launch canceled! 

and the following is written to adb logcat:

INFO/zipro(2499): Could not find end-of-central-directory in Zip
DEBUG/asset(2499): failed to open Zip archive '/data/local/tmp/MyProject.apk'
WARN/PackageParser(2499): Unable to read AndroidManifest.xml of /data/local/tmp/MyProject.apk
WARN/PackageParser(2499): java.io.FileNotFoundException: AndroidManifest.xml
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:523)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:491)
WARN/PackageParser(2499):     at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:597)
WARN/PackageParser(2499):     at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:126)
WARN/PackageParser(2499):     at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:100)
WARN/PackageParser(2499):     at android.os.Binder.execTransact(Binder.java:288)
WARN/PackageParser(2499):     at dalvik.system.NativeStart.run(Native Method)
ERROR/PackageManager(1579): Failed to handle start copy. Giving up
ERROR/PackageManager(1579): java.lang.NullPointerException
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1253)
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1235)
ERROR/PackageManager(1579):     at com.android.internal.app.IMediaContainerService$Stub$Proxy.getMinimalPackageInfo(IMediaContainerService.java:220)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$InstallParams.handleStartCopy(PackageManagerService.java:5065)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$HandlerParams.startCopy(PackageManagerService.java:4954)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:476)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:421)
ERROR/PackageManager(1579):     at android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/PackageManager(1579):     at android.os.Looper.loop(Looper.java:143)
ERROR/PackageManager(1579):     at android.os.HandlerThread.run(HandlerThread.java:60)

When I try to install it using adb shell from cmd prompt I get:

EOCD not found, not Zip
file 'D:\Workspace\MyProject\bin\MyProject.apk' is not a valid zip file

I have tried cleaning the project/ deleting the gen folder / deleting the debug keystore. Nothing worked;

Please advise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

明媚如初 2024-11-13 04:06:54

请参阅这个主题,他们解决了问题can' t 从 eclipse 启动应用程序

See this thread they solved the issue : can't launch the application from eclipse

落日海湾 2024-11-13 04:06:54

我遇到了类似的问题,并且在 eclipse 控制台中收到类似的日志,

[2011-12-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-12-06 10:35:38 - MyProject] (null)
[2011-12-06 10:35:38 - MyProject] Launch canceled!

但是清理和重建项目解决了问题。

I had a similar problem and was getting similar logs in eclipse console

[2011-12-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-12-06 10:35:38 - MyProject] (null)
[2011-12-06 10:35:38 - MyProject] Launch canceled!

But cleaning and rebuilding the project solved the problem.

岁月静好 2024-11-13 04:06:54

我有类似的问题。
我已将 zip 文件复制到源文件夹中:-例如;该包是 com.example.demo

,我已将该文件放入 com 文件夹中。
它向我展示了与您得到的相同的错误。
我不确定你的情况,但在再次编写代码之前,只需检查整个项目是否出现错误!

I had a similar problem.
I had copied a zip file into the source folder:-e.g;the package was com.example.demo

and I had put the file in com folder.
It showed me the same error as you get.
I'm Not sure about ur case but before writing the code again, just check the whole project if something has gone wrong by mistake!!

谈情不如逗狗 2024-11-13 04:06:54

似乎 Ganymede 与

http://developer.android.com/sdk/requirements 中的 ADT 10.0 不兼容.html

支持的开发环境
Eclipse集成开发环境

* Eclipse 3.5 (Galileo) or greater

  Note: Eclipse 3.4 (Ganymede) is no longer supported with the latest version of ADT.

Seems like Ganymede is not compatible with ADT 10.0

From http://developer.android.com/sdk/requirements.html :

Supported Development Environments
Eclipse IDE

* Eclipse 3.5 (Galileo) or greater

  Note: Eclipse 3.4 (Ganymede) is no longer supported with the latest version of ADT.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文