I can\'t run my app on AVD. I get this error.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionF
It worked.Use these commands on VSCode.
Make sure you have enough RAM for gradle process by updating org.gradle.jvmargs in your gradle.properties.
Make sure your Gradle version and gradle plugin are compatible; refer to this table: https://developer.android.com/studio/releases/gradle-plugin#updating-gradle (i suggest plugin 3.5.3 with gradle 5.4.1 as of this writing!)
And what might be happening to some without knowing it, is not using JDK 8! I tried with JDK 11 and saw many different R8 and dexing errors! Also looks like this whole setup does not work with Eclipse OpenJ9 JDK distribution! so make sure you are using standard OpenJDK of your OS (mine would be default OpenJDK-8 from Debian)
Finally I fixed it.
Change org.gradle.jvmargs=-Xmx1536m
to org.gradle.jvmargs=-Xmx1536m -Duser.country=US -Duser.language=en
Change classpath 'com.android.tools.build:gradle:3.5.0'
to classpath 'com.android.tools.build:gradle:3.4.2'
Android Studio - How to fix Internal error when trying to read zip file
This error can also be arise due any vector asset. I resolve by removing that vector asset file. Please check if you recently made any change to your vector asset file.
Check if your APK is locked by external tool (or even IDE)
(...)\app\release\app-release.apk
Had same issue, proposed solutions did't work for me.
In my case problem was caused by signing config: I did set storePassword
field, but didn't set keyPassword
field in my signingConfigs
section (passwords were same).
So if you have your signing config in app's build.gradle
file, try to set Key Password
field in File -> Project Structure -> Modules
dialogue or by adding keyPassword
field in your signingConfigs
section in build.gradle
:
android {
signingConfigs {
release {
storeFile file('C:\\PathToKey\\key.jks')
storePassword 'myPassword'
keyAlias 'myAlias'
keyPassword 'myPassword'
}
}
...
}