The APK file D:\Code\Air\app\build\outputs\apk\.apk does not exist on disk.
来源:互联网 发布:淘宝最大的网店 编辑:程序博客网 时间:2024/05/14 04:30
今天在手机上运行调试的项目时候提示
Session 'app': Error Installing APK
再看具体日志提示:
The APK file D:\Code\Air\app\build\outputs\apk\.apk does not exist on disk.
尝试了,rebuild,clean,restart等等方法未果,后来google,不得不说google的强大,查到一篇这样的文章:
https://stackoverflow.com/questions/39765345/the-apk-file-does-not-exist-on-disk-but-it-does
对比一下,我正好在gradle中封装了打包的日期,如下:
applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile def fileName if (outputFile != null && outputFile.name.endsWith('.apk')) { // 输出apk名称为XXapp1.4.0_2017-02-14.apk if (variant.buildType.name.equals('release')) { fileName = "air_${defaultConfig.versionCode}_v${defaultConfig.versionName}_${releaseTime()}_${debugTime()}_release.apk" } else if (variant.buildType.name.equals('debug')) { fileName = "air_${defaultConfig.versionCode}_v${defaultConfig.versionName}_${releaseTime()}_${debugTime()}_debug.apk" } output.outputFile = new File(outputFile.parent, fileName) } } }
项目gradle中添加了时间:
def releaseTime() { return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}def debugTime() { return new Date().format("HH-mm", TimeZone.getTimeZone("GMT+8"))}
所以出现这个问题,解决办法在调试的时候先注释掉这部分代码,打包的时候再添加上吧,或者封装的时候就不要把时间添加上了
阅读全文
0 0
- The APK file D:\Code\Air\app\build\outputs\apk\.apk does not exist on disk.
- Launching app : The APK file xxxx.apk does not exist on disk Error while Installing APK
- 解决\build\outputs\apk\dream-debug.apk does not exist on disk错误
- The APK file app-debug.apk does not exist on disk.
- Android Studio The APK file does not exist on disk
- The APK file **** does not exist on disk
- Android Studio The APK file does not exist on disk
- The APK file does not exist on disk
- EmptyThrowable: The APK file does not exist on disk.
- The APK file does not exist on disk
- The APK file does not exist on disk
- The APK file xxx.apk does not exist on disk. Error while Installing APK
- The APK file xxx.apk does not exist on disk. Error while Installing APK
- The APK file does not exist on disk.Error while Installing APK
- The APK file does not exist on disk.Error while Installing APK
- Android Studio编译后安装apk报错:The APK file does not exist on disk
- the apk file does not exist on disk. error while installing apk
- Android Studio编译后安装apk报错:The APK file does not exist on disk
- 设计模式--享元模式
- layer.msg 添加回调函数
- 电影《妖妖铃》改名为《妖铃铃》
- 使用go读取gzip格式的压缩包
- Myeclipse学习总结(14)——Eclipse/MyEclipse中Java编译时Java反射机形参没有保留问题2种解决方案
- The APK file D:\Code\Air\app\build\outputs\apk\.apk does not exist on disk.
- linux 常用命令 (长期更新中...)
- android欢迎界面动态效果实例代码(旋转/由小变大/淡入)
- 冰雪经济下,全民滑雪进入国际化的“黄金时代”
- web前端 JS笔记
- Nginx内存管理详解
- 东南卫视肌肤食品微商套路解析
- c#实现16进制和字符串之间转换的代码
- 互联网汽车普及后,《速度与激情8》的僵尸车会成为现实吗?