How to fix this error “A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade”

后端 未结 14 2010
死守一世寂寞
死守一世寂寞 2021-01-02 02:04

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

相关标签:
14条回答
  • 2021-01-02 02:39

    It worked.Use these commands on VSCode.

    1. flutter clean
    2. flutter pub cache repair
    0 讨论(0)
  • 2021-01-02 02:41

    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)

    0 讨论(0)
  • 2021-01-02 02:48

    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

    0 讨论(0)
  • 2021-01-02 02:49

    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.

    0 讨论(0)
  • 2021-01-02 02:49

    Check if your APK is locked by external tool (or even IDE)

    (...)\app\release\app-release.apk
    
    0 讨论(0)
  • 2021-01-02 02:49

    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'
            }
        }
        ...
    }
    
    0 讨论(0)
提交回复
热议问题