A failure occurred while executing com.android.build.gradle.internal.tasks

后端 未结 19 4389
臣服心动
臣服心动 2020-12-04 23:27

I am getting this error while I am building APK.

Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while          


        
19条回答
  •  生来不讨喜
    2020-12-05 00:10

    Solution for:

    Caused by 4: com.android.builder.internal.aapt.AaptException: Dependent features configured but no package ID was set.
    

    All feature modules have to apply the library plugin and NOT the application plugin.

    build.gradle (:androidApp:feature_A)

    apply plugin: 'com.android.library'
    

    It all depends on the stacktrace of each one. Cause 1 WorkExecutionException may be the consequence of other causes. So I suggest reading the full stacktrace from the last cause printed towards the first cause. So if we solve the last cause, it is very likely that we will have fixed the chain of causes from the last to the first.

    I attach an example of my stacktrace where the original or concrete problem was in the last cause:

    Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
    
    Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-4.2.0-alpha16-6840111-linux Daemon #0: Unexpected error during link, attempting to stop daemon.
    
    Caused by: java.io.IOException: Unable to make AAPT link command.
    
    Caused by 4: com.android.builder.internal.aapt.AaptException: Dependent features configured but no package ID was set.
    

    GL

    Feature Package ID was not set

提交回复
热议问题