8

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
Paolo Rotolo
  • 1,243
  • 1
  • 14
  • 22

4 Answers4

1

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
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
Paolo Rotolo
  • 1,243
  • 1
  • 14
  • 22
  • 4
    This somehow doesn't help me, I am on Android Studio 3, and once I do this, I get the following error: "Error:(10, 0) Minimum supported Gradle version is 4.1. Current version is 4.1-rc-2. Please fix the project's Gradle settings." – Aman Alam Oct 07 '17 at 09:39
  • 3
    same exact issue for me. – Gubatron Oct 25 '17 at 23:42
  • 3
    I'm getting this too, I swear each major android studio release, something breaks and you're just left to wonder why :( – Boardy Oct 30 '17 at 14:57
1

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'
Gubatron
  • 6,222
  • 5
  • 35
  • 37
0

You should check your AndroidManifest.xml,make sure every element like 'action' or 'category' is in right position.

forevas
  • 41
  • 6
0

I have got the similar issue recently, The way I solved is by invalidating the cache. You can do that in android studio-> File-> Invalidate cache/ Restart.

After that it stop showing me those ActivityFeed error.

Nikunj Sakhrelia
  • 449
  • 3
  • 12