Android studio keeps telling me that the build has failed. I am not using Kotlin and all my code is in JAVA. I keep getting this error ONLY when i want to build/run the project. I always need to delete .gradle folder and restart Android studio to get this working again. It's not an IDE issue i feel as I have used both IDE version 3.1 and 3.3. I have also updated Kotlin to the latest version currently 1.2.70
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:processProdDebugManifest'.
> java.lang.IllegalAccessException: Class kotlin.reflect.jvm.internal.FunctionCaller$FieldSetter can not access a member of class com.android.build.gradle.tasks.ManifestProcessorTask with modifiers "private"
ext.kotlin_version = "1.2.70"
After a complete restart and invalidating cache the build succeeds, but after any new changes i make it cant build again until i restart the entire IDE and delete the .gradle folder
here are my root Project version numbers
ext {
// SDK and tools
minSDK = 18
targetSDK = 28
compileSDK = 28
buildTools = '28.0.2'
// SUPPORT LIBRARY
SupportLibrary = '28.0.0-rc02'
// Debug the App
debugMode = true
minify = true
proguard = false
multidex = false
// App Versioning
versionCode = 7
versionName = 0.7
}
Every time this problem occurs, I restart / invalidate the cache and the problem is resolved.
File > Invalidate Caches/Restart... > Invalidate and Restart
If you using the alpha gradle build tool
classpath 'com.android.tools.build:gradle:3.3.0-alpha10'
then downgrade to
classpath 'com.android.tools.build:gradle:3.2.0'
This worked for me.
I solved the issue by updating to Android
Studio 3.3 Canary 11 Build #AI-182.4323.46.33.5012296
Make sure to update the gradle as well. A pop up will prompt on your first boot after the update.
This was a bug in gradle version 3.3.0-alpha13 which can be fixed by upgrading you gradle version.
To fix this issue, upgrade your gradle version in project level build.gradle
classpath 'com.android.tools.build:gradle:3.4.0-alpha01'
Original answer https://stackoverflow.com/a/52965104/3948854
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