When I try to install an app, there are two possibilities:
- Install existing APK from build folder when I run the
app
- Install APK after performing
clean build
For existing APK in the build folder, the app just works fine. But when I clean the project using Build
-> Clean Project
, and then try to run the app
(i.e. install the app to my emulator or physical device), it shows me error:
The APK file /Users/MyApplicationName/app/build/outputs/apk/app-debug.apk does not exist on disk.
NOTE: This behaviour happens only when I clean the project and not when I have already have a pre-built app APK in my build folder
I've referred to: The APK file does not exist on disk but my point is, when we usually run the app after cleaning the project, we never need to make a build of it, if the APK is not existing in the build folder, it automatically generates and installs the latest one.
Things I've tried:
- Running the app when APK file exists in the build folder (works perfectly fine)
- Running the
Clean Project
-> Running the app (expected is the project would be built and the app would get installed but it shows the above mentioned error!) - Same process of cleaning and running the app after doing
Invalidate Caches/Restart
Build -> Clean Project->Rebuild Project
– Chaise