我的Android進階之旅------>解決Android Studio編譯後安裝apk報錯:The APK file does not exist on disk

來源:互聯網
上載者:User

標籤:

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.