Quick Guide Summary:
- Fixes the “Error loading build artifacts” (redirect.txt) error when running an app on an emulator after upgrading Android Studio from Ladybug to Otter.
- Run the AGP Upgrade Assistant to bump Gradle 8.10.2 → 8.13 and AGP 8.8.1 → 8.13.2 in
gradle-wrapper.propertiesandlibs.versions.toml. - Remove and re-add “Gradle-aware Make” under Edit Configurations → Before Launch, leaving the task field empty.
Problem:
After upgrading Android Studio from “Ladybug” to “Otter” I started getting the following error message when I run my app on my emulated test device:
"Error loading build artifacts from: .../myProjectRootDir/app/build/intermediates/apk_ide_redirect_file/productionDebug/createProductionDebugApkListingFileRedirect/redirect.txt"
Solution:
First, I ran the AGP Upgrade Assistant, which updated 2 files:
.../myProjectRootDir/gradle/wrapper/gradle-wrapper.properties
Distribution URL has been upgraded fromdistributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.ziptodistributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip.../myProjectRootDir/gradle/libs.versions.toml
AGP version updated fromagp = '8.8.1'toagp = '8.13.2'
And then, applied a “Run Configuration” Fix:
- Click the Edit Configurations dropdown (next to the “Play” button).
- Select your app configuration on the left.
- Scroll to the “Before Launch” section at the bottom.
- Remove “Gradle-aware Make” (select it and click the minus – button).
- Re-add it: Click +, select Gradle-aware Make, and leave the task field empty. Click OK.
- Click Apply -> OK.
- Run the app.
Additional things to try if above suggestions weren’t sufficient to fix the issue:
- Invalidate caches
- Clean the build before re-running
- Sync Gradle files