Solve the problem of installing APK after Android studio compilation: error while installing apk

1. Error description

Today, when I compiled the app with Android studio and installed APK, I reported an error as follows:

The APK file build\outputs\apk\OYP_2.3.4_I2Base_6476_official_debug.apk does not exist on disk.
Error while Installing APK

1 2

As shown in the figure below,

2. Solutions

1. Try build – & gt; clean project recompilation or invalid
2. Try to restart Android studio is invalid

Then I went to the build/outputs/APK directory and found that the APK file was compiled, but the file name was:
oyp_ 2.3.4_ I2Base_ 6478_ official_ debug.apk
as shown in the figure below:

So the reason is that the compiled APK file of Android studio is

OYP_ 2.3.4_ I2Base_ 6478_ official_ debug.apk

And it’s going to install the APK file name

OYP_ 2.3.4_ I2Base_ 6476_ official_ debug.apk
as a result, an error will be reported. Google looked up the error and found it in http://stackoverflow.com There is a solution to this error on the website, and the link is as follows:
the http://stackoverflow.com/questions/34039834/the-apk-file-does-not-exist-on-disk

Solution:
as shown in the figure below:

Step 1: click the gradle button in the Android studio sidebar, as shown below

Step 2: refresh the gradle configuration

The third step: recompile, no more error.

Read More: