无法通过Eclipse在Android设备上安装APK
不久前,我开始使用 Phonegap 和 Eclipse 以及 Android 2.3.3 SDK 开发一个小型 Android 应用程序。我在我的 HTC Sensation 上运行了我的构建,一切顺利。今天,我决定对我的手机进行 root 并安装 ICS rom,效果很好(如果有的话,可以是 Android Revolution 5.0.2)。我下载了 4.0 和 4.0.3 SDK 以及更新的 ADT,但我似乎无法再为我的设备构建。 LogCat 给我以下警告:
12-26 18:12:24.251: W/asset(17419): Asset path /data/local/tmp/myapp.apk is neither a directory nor file (type=0).
12-26 18:12:24.251: W/DefContainer(17419): Failed to parse package
12-26 18:12:24.251: W/ActivityManager(11546): No content provider found for permission revoke: file:///data/local/tmp/myapp.apk
事实上,我可以在设备上看到 /data,但看不到 /data/local/。有人遇到过类似的情况吗?
I started working on a small Android app using Phonegap and Eclipse a while ago with the Android 2.3.3 SDK. I ran my builds on my stock HTC Sensation and all was well. Today I decided to root my phone and install an ICS rom, which works fine (Android Revolution 5.0.2 if it matters). I downloaded the 4.0 and 4.0.3 SDKs as well as updated ADT but I cannot seem to be able to build for my device anymore. LogCat gives me the following warnings:
12-26 18:12:24.251: W/asset(17419): Asset path /data/local/tmp/myapp.apk is neither a directory nor file (type=0).
12-26 18:12:24.251: W/DefContainer(17419): Failed to parse package
12-26 18:12:24.251: W/ActivityManager(11546): No content provider found for permission revoke: file:///data/local/tmp/myapp.apk
In fact, I can see /data on the device but not /data/local/. Has anyone ever encountered a similar situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
问题出在安装目录权限上。 /data/local 需要拥有其他人的写入和执行权限,才能正确安装 adb 包。
The problem was with the install directory permissions. /data/local needs to have write and execute rights to others in order for adb packages to install correctly.
很平常,但请务必在 Eclipse 中检查 Android 工具更新。那是我的问题。
Mundane, but be sure to check for Android tools updates in Eclipse. That was my problem.
执行:
然后像平常一样重新安装您的应用程序。
Do an:
and then reinstall your application as normal.
貌似apk名称不能包含“$”或者“{}”之类的符号。一旦我从 apk 名称中删除这些字符,该 apk 就可以很好地安装在设备上。
It seems that the apk name cannot contain some symbols such as "$" or "{}". As soon as I deleted those characters from the apk name, the apk was installed fine on the device.