The APK file xxx.apk does not exist on disk. Error while Installing APK

来源:互联网 发布:确保数据完整准确 编辑:程序博客网 时间:2024/05/16 05:48

今天编译装包到测试机莫名其妙的报了这个问题, 发现这个文件确实在该文件夹下是存在的, 不知道是不是as的bug
好吧百度下吧, 
http://m.blog.csdn.net/qq446282412/article/details/51243441
http://blog.csdn.net/afunx/article/details/70313402
这两篇文章介绍的方法都试过了,但是没有解决问题...........
最后在  https://stackoverflow.com/questions/34039834/the-apk-file-does-not-exist-on-disk   找到了答案, 并且解决了问题
 引起该问题的原因大致是使用build.gradle script 中

variant.outputs.each { output ->    def outputFile = output.outputFile    if (outputFile != null && outputFile.name.endsWith('.apk')) {       // apk_渠道名-版本号-版本名称-编译时间.apk       def fileName = "xxx.apk"       tput.outputFile = new File(outputFile.parent, fileName)    }}
给apk文件重命名时发生了问题, 如果除.apk之外的文件名中还包含. 的话, 可能会出现这个问题,
好吧 将重命名格式改的简单点, 问题就解决了...记录下, 希望也能帮到大家解决类似问题

阅读全文
0 0