標籤:
1、錯誤描述
今天用Android Studio編譯應用後安裝APK的時候,報錯了,錯誤如下所示:
The APK file build\outputs\apk\OYP_2.3.4_I2Base_6476_official_debug.apk does not exist on disk.Error while Installing APK
如所示
2、解決方案
1、嘗試了Build -> Clean Project再編譯,還是無效
2、嘗試重啟Android Studio無效
然後我去開啟build\outputs\apk\目錄,發現裡面編譯好了APK檔案,不過檔案名稱確實:
OYP_2.3.4_I2Base_6478_official_debug.apk
如所示:
因此原因就是,Android Studio編譯好之後的APK檔案是
OYP_2.3.4_I2Base_6478_official_debug.apk
而它要安裝APK檔案名稱確實
OYP_2.3.4_I2Base_6476_official_debug.apk
因此就會報錯了。google查了一下錯誤,在http://stackoverflow.com網站上有一篇關於此錯誤的解決方案,連結如下所示:
http://stackoverflow.com/questions/34039834/the-apk-file-does-not-exist-on-disk
解決方案:
如所示:
第一步:點擊Android Studio側邊欄的Gradle按鈕,如下所示
第二步:重新整理下Gradle的配置
第三步:重新編譯即可,不會再報錯。
歐陽鵬 歡迎轉載,與人分享是進步的源泉!
轉載請保留原文地址:http://blog.csdn.net/ouyang_peng
我的Android進階之旅------>解決Android Studio編譯後安裝apk報錯:The APK file does not exist on disk