Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to build project with gradle 4.1: "unknown element * found"

Tags:

android

gradle

After updating to Gradle 4.1 I'm unable to build my project (all works fine with previous releases).

Basically it doesn't recognize AndroidManifest tags anymore and gives me errors in the generated manifest in /build/intermediates/manifests/full/debug.

Here's the build log:

/home/paolorotolo/dev/exp/***/build/intermediates/manifests/full/debug/AndroidManifest.xml
    Error:(30) unknown element <action> found
    Error:(32) unknown element <category> found
    Error:(33) unknown element <category> found
    Error:/home/paolorotolo/dev/exp/core/***/build/intermediates/manifests/full/debug/AndroidManifest.xml:30 unknown element <action> found
    Error:/home/paolorotolo/dev/exp/core/***/build/intermediates/manifests/full/debug/AndroidManifest.xml:33 unknown element <category> found
    Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
    Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
    Error:Execution failed for task ':***:processDebugResources'.
    > Failed to execute aapt
    Information:BUILD FAILED in 6s
like image 630
Paolo Rotolo Avatar asked Jul 28 '17 12:07

Paolo Rotolo


2 Answers

The issue has been fixed in new gradle release (gradle-4.1-rc-2).

To solve add in your gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-2-all.zip
like image 143
Paolo Rotolo Avatar answered Oct 25 '22 08:10

Paolo Rotolo


For now using gradle 4.1, or even 4.2 on your gradle wrapper will break builds that have dependencies

I solved this issue by taking back my gradle classpath depency back to gradle 2.3.3

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
like image 39
Gubatron Avatar answered Oct 25 '22 09:10

Gubatron