`
CshBBrain
  • 浏览: 638436 次
  • 性别: Icon_minigender_1
  • 来自: 成都
博客专栏
B7d9bf34-126e-301f-819e-81f2615b5a2a
开源WebSocket服务...
浏览量:142200
Group-logo
HTML5移动开发
浏览量:135557
社区版块
存档分类
最新评论

Installation failed due to invalid APK file

 
阅读更多

转自:http://sunzeduo.blog.51cto.com/2758509/1279335/

 

root过了手机,发现再次安装程序出现了 Installation failed due to invalid APK file

这样的错误,后来再看logcat 发现是

Unable to open zip '/data/local/tmp/QuanZi.apk': Permission denied

这样的原因,但是将data/local/tmp 的权限修改了发现还是不行,最后通过查找,发现使用软连接的方式,将/data/local/tmp 到 /mnt/sdcard/tmp 这个下面,发现就可以了,也就是以后我的这个手机程序的安装都首先要在sdcard下安装了

 

ln -s /mnt/sdcard/tmp /data/local/tmp 下面的查找的资料

 

I got exactly the same problem, and this solution fixed it, so i hope it does for you too.

The reason for "permission denied" is that apk files uploaded to /data/local/tmp had to low permissions, and the installer process obviously did not have permissions to read any such file.

I never found a solution, but have a workaround that satisfies me. I have simply moved/symlinked the tmp directory to the SD card. Since SD card is formatted as FAT, it does not have owners/permissions and all files created there are always readable by everyone. So open a terminal emulator on your phone. Get root ("su") and type in:

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics