I am using Android Studio to debug my application. For some reasons, I have to change the default output apk directory and file name. So I changed the applicationVariants' outputDirectory and outputFileName in app's build.gradle script. This modification make the apk output to the expected place and name. But I found a problem is that when I start to debug the app just like before, AS said:
Installation did not succeed.
The application could not be installed.
List of apks:
[0] 'C:\Users\progquest\projects\Study\app\build\outputs\apk\free\debug\app-free-debug.apk'
Installation failed due to: 'Invalid File: C:\Users\progquest\projects\Study\app\build\outputs\apk\free\debug\app-free-debug.apk'
Note: 'free' is a product flavor of my application.
Obviously, the debugger still used the old default output directory and apk file name to find the source apk. How to change it?
Thank you.
This happened to me; it started working again after I unselected and then re-selected the correct "Active Build Variant" in the "Build Variants" tool (even though it was already selected).