I was running android application very well then i updated Android Studio to 3.0 and Gradle version to latest 4.1. After Synch the project i got following build error
e.project.sync.GradleSyncState - Gradle sync failed: Exception thrown while executing model rule:
BaseComponentModelPlugin.Rules#createVariantData(ModelMap<AndroidBinaryInternal>, ModelMap<AndroidComponentSpec>, TaskManager) > afterEach()
I will be thankful for this quick favour.
Then open Android Studio and go to File > Settings > Build, Execution and Deployment > Gradle > Use Gradle from > Set the path of the downloaded Gradle. Step 4. Now try syncing the Gradle again and check if the error still persists.
We can configure the settings for how IntelliJ IDEA syncs with Gradle by pressing the settings icon in the Gradle tool window, and selecting Auto-Reload Settings. We can set IntelliJ IDEA to automatically reload the project after "Any changes" in the build script files, so changes are automatically reloaded.
Temporary solution, which worked for me, was to change the following things:
In top level .gradle file - change version of experimental plugin to 0.9.3:
dependencies { classpath 'com.android.tools.build:gradle-experimental:0.9.3' classpath 'com.google.gms:google-services:3.0.0' }
Change Gradle plugin version from 4.1 to 3.3 in gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
It works with android studio 3.0
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