After update of Android Studio 3.6 & Gradle to 3.5.0 unable to run project
Asked Answered
L

3

13

Everything was working smoothly but after update of Android Stdio 3.6 & Gradle to 3.5.0, Project is not building, Getting bellow errors

 FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource compilation failed
     C:\Users\Amin\.gradle\caches\transforms-2\files-2.1\c1ea7b9f1e5ec36cfafa4328570d20ad\constraintlayout-2.0.0-beta2\res\values\values.xml:321:5-600: AAPT: error: duplicate value for resource 'attr/pivotX' with config ''.

     C:\Users\Amin\.gradle\caches\transforms-2\files-2.1\c1ea7b9f1e5ec36cfafa4328570d20ad\constraintlayout-2.0.0-beta2\res\values\values.xml:321:5-600: AAPT: error: resource previously defined here.

     C:\Users\Amin\.gradle\caches\transforms-2\files-2.1\c1ea7b9f1e5ec36cfafa4328570d20ad\constraintlayout-2.0.0-beta2\res\values\values.xml:321:5-600: AAPT: error: duplicate value for resource 'attr/pivotY' with config ''.

Here is gradle.properties

org.gradle.jvmargs=-Xmx4608m
android.enableJetifier=true
android.useAndroidX=true
Leninakan answered 9/9, 2019 at 11:13 Comment(7)
just do clean and rebuild projectGimble
do file -> Invalidate Caches and restartGimble
tried this also, still no luck :(Leninakan
Invalidate cashes / Resart from file menu. that worked for meDardanus
try upgrade the gradle latest versionGimble
gradle is also up to dateLeninakan
add this line to gradle.properties: org.gradle.jvmargs=-Xmx4608mRoz
L
6

Finally.. I have solved the problem.. I observed error was in constraintlayout as per logcat and observed the constraintlayout version which was alpha I downgrade the version to implementation 'androidx.constraintlayout:constraintlayout:1.1.3' and the issue got fixed.

Leninakan answered 9/9, 2019 at 12:30 Comment(3)
I have the same error and weirdly enough my error is at res/values/strings.xmlWaspish
@Waspish did u fix it ? If yes then would mind explaining me the reason please ? I am also facing the exact same error during release build.Rimini
@Rimini Hope you can fix this issue. I don't have a lot of confidence in those old Android libraries. I suggest removing the line where the code is showing you an error and trying again. One option is to remove libraries that show the problemWaspish
D
2

Try changing in gradle.properties

org.gradle.jvmargs=-Xmx4096m
Deservedly answered 22/12, 2021 at 6:25 Comment(0)
S
0

Anyone that tried to do so with com.android.tools.build:gradle:3.5.2 and Gradle Version 5.4.1 the fix is the same - make sure you are working with

androidx.constraintlayout:constraintlayout:1.1.3

when using 3.5.0 and up without androidx.constraintlayout:constraintlayout:1.1.3 - the UI will be blank (inflate exception) for any view that is extending ConstraintLayout.

Swimmingly answered 11/12, 2019 at 14:37 Comment(1)
Relieved (or should that be depressed?) to know there are just as many bugs in Android Studio as in Visual Studio ..Cuthburt

© 2022 - 2024 — McMap. All rights reserved.