Have anyone faced this issue with the new Android Studio 4.1. When I run the app to the simulator, everything works and builds. Later it also shows a message
In the run, the error message is
Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: Error loading build artifacts from: LOCATION/build/outputs/apk/act/debug/output-metadata.json
I see this when switching branches from one that uses Android Gradle Plugin 4.0.1 and Gradle 6.1.1 to one that uses Android Gradle Plugin 4.1.1 and Gradle 6.5.
The workaround here is to manually run File > Sync Project with Gradle Files.
I just figured out that, if you upgrade your gradle in one branch and change your branch to something which had the old gradle, you may face this issue.
I just updated the gradle and it fixed the issue.For me I change from
classpath 'com.android.tools.build:gradle:4.0.1'
to
classpath 'com.android.tools.build:gradle:4.1.2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With