Android Studio 3.2 Canary 13 Clean Build后构建崩溃求助
Hey Derek, sorry to hear you're hitting this finicky build error—early Canary builds often clash with third-party plugin integrations like Crashlytics. Let's walk through targeted fixes to resolve this permanently, instead of relying on temporary workarounds.
First, let's align on your environment to ensure we're troubleshooting the right setup:
- Android Studio: 3.2 Canary 13
- Gradle distribution:
gradle-4.6-all - Android Gradle Plugin:
com.android.tools.build:gradle:3.2.0-alpha13 - Kotlin version:
1.2.41
The error you encountered:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithInstantRunV...
Here are the most effective solutions to fix this root issue:
1. Disable Instant Run (the most common culprit)
Instant Run frequently causes compatibility conflicts with plugins in early Canary builds. Let's turn it off to test:
- Navigate to
File > Settings > Build, Execution, Deployment > Instant Run - Uncheck Enable Instant Run to hot swap code/resource changes on deploy
- Run a full
Clean Projectfollowed byRebuild Project—this should eliminate the transform error if Instant Run was the problem.
2. Update Crashlytics & Google Services plugins
Outdated plugin versions often clash with newer Android Gradle Plugin (AGP) releases. Update your project-level build.gradle to use the latest compatible versions:
buildscript { ext.kotlin_version = '1.2.41' repositories { google() jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:3.2.0-alpha13' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Update to these verified compatible versions classpath 'io.fabric.tools:gradle:1.26.1' classpath 'com.google.gms:google-services:4.2.0' } }
After updating, sync your project and run another Clean Rebuild.
3. Invalidate Caches & Restart Android Studio
Corrupted build caches often trigger unexplained errors after adding new plugins. Clear them out completely:
- Go to
File > Invalidate Caches / Restart - Select Invalidate and Restart (don't just restart—make sure to invalidate)
- Once Studio reopens, run your Clean Build again.
4. Verify Kotlin Plugin & Version Match
A mismatch between the Kotlin plugin installed in Android Studio and the version specified in your build.gradle can trigger transform errors:
- Go to
Tools > Kotlin > Configure Kotlin Plugin Updates - Ensure the installed plugin version matches
1.2.41(or consider updating both the plugin and yourext.kotlin_versionto the latest stable version compatible with your AGP)
5. Isolate the Issue by Temporarily Disabling Crashlytics
To confirm Crashlytics is the source of the conflict, comment out its dependencies and plugin lines in your app-level build.gradle:
// Comment these lines out temporarily // apply plugin: 'io.fabric' // dependencies { // implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5' // }
Run a Clean Build—if the error disappears, the issue is a compatibility gap between Crashlytics, AGP 3.2.0-alpha13, and Instant Run. In that case, sticking with disabled Instant Run until a plugin update fixes the compatibility is your best short-term fix.
Give these steps a try—most users resolve this issue with either disabling Instant Run or updating their plugins. Let me know if any of these work for you!
内容的提问来源于stack exchange,提问作者Derek Zhu

