简体   繁体   English

权限被拒绝导致“安装因APK文件无效而失败”

[英]Permission denied causing “Installation failed due to invalid APK file”

When I try to run my app on my Nexus 4 running 4.2.1, I kept on getting this error in eclipse: 当我尝试在运行4.2.1的Nexus 4上运行我的应用程序时,我继续在eclipse中收到此错误:

[2012-12-22 19:30:51 - Rhiokai] Installation failed due to invalid APK file!
[2012-12-22 19:30:51 - Rhiokai] Please check logcat output for more details.
[2012-12-22 19:30:51 - Rhiokai] Launch canceled!

I tired pushing and installing via adb but it didn't work either. 我厌倦了通过adb推送和安装,但它也没有用。 I figured out that it was because of this message in Logcat: 我发现这是因为Logcat中的这条消息:

12-22 19:37:29.326: W/zipro(7371): Unable to open zip '/data/local/tmp/Rhiokai.apk': Permission denied
12-22 19:37:29.326: D/asset(7371): failed to open Zip archive '/data/local/tmp/Rhiokai.apk'

Any ideas on how to fix this issue? 有关如何解决此问题的任何想法?

I started receiving this error after rooting my phone. 在我的手机生根后我开始收到此错误。

The reason for "permission denied" is that apk files uploaded to /data/local/tmp had the -rw----- permission and owned by root, and the installer process obviously did not have permissions to read any such file. “权限被拒绝”的原因是上传到/ data / local / tmp的apk文件具有-rw -----权限并由root拥有,并且安装程序进程显然没有读取任何此类文件的权限。

I never found a solution, but have a workaround that satisfies me. 我从来没有找到解决方案,但有一个满足我的解决方法。 I have simply moved/symlinked the tmp directory to the SD card. 我只是将tmp目录移动/符号链接到SD卡。 Since SD card is formatted as FAT, it does not have owners/permissions and all files created there are always readable by everyone. 由于SD卡格式化为FAT,因此它没有所有者/权限,并且在那里创建的所有文件总是可供所有人阅读。

# cd /data/local
# mv tmp tmp-old # (or simply rm -rf tmp)
# mkdir /mnt/sdcard/tmp
# ln -s /mnt/sdcard/tmp ./tmp

What operating system are you using? 您使用什么操作系统? Perhaps your folder is lacking the appropriate permissions? 也许你的文件夹缺少相应的权限?

令人讨厌的是,关闭电话并重新打开电话的古老技巧再次起作用

如果您已在设备上使用具有相同程序包名称的已签名版本的应用程序,则可能需要在重新安装之前将其卸载(除非您要再次签名,然后将该已签名的应用程序上载到设备)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于APK文件无效,安装失败! (尝试运行模拟器时)在尝试导出时也失败 - Installation failed due to invalid APK file! (when attempting to run emulator) Also fails when attempting to export 由于URI无效,安装失败 - Installation failed due to an invalid URI Android,apk安装INSTALL_FAILED_POLICY_REJECTED_PERMISSION - Android, apk installation INSTALL_FAILED_POLICY_REJECTED_PERMISSION 打开失败:尝试创建 csv 文件时出现 EACCES(权限被拒绝) - open failed: EACCES (Permission denied) while trying to create csv file NOTES Alpha:复制文件时出错:打开失败:EACCES(权限被拒绝) - NOTES Alpha: Error copying file : open failed: EACCES (Permission denied) 打开失败:EACCES(权限被拒绝)? - Open failed: EACCES (Permission denied)? 错误的错误消息“无法锁定配置文件.git / config:权限被拒绝”,原因是未进行分阶段的更改; 在安装openJDK 8时在Homebrew中 - error of “could not lock config file .git/config: Permission denied” due to unstaged changes; in Homebrew while installing openJDK 8 Aapt2Exception:Android 资源链接失败输出:错误:无法打开 APK:文件无效 - Aapt2Exception: Android resource linking failed Output: error: failed to open APK: Invalid file 即使卸载旧版APK,Android APK安装也失败 - Android APK installation failed even after uninstalling old apk 由于Win8权限低,安装失败 - Installation failed due to low priviledge on Win8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM