7

Updated to Android studio 3 and am now getting the following error

Error:/app/build/intermediates/res/merged/debug/values/com_crashlytics_build_id.xml uncompiled XML file passed as argument. Must be compiled first into .flat file.

Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:

MobileMon
  • 8,341
  • 5
  • 56
  • 75
  • Mike from Fabric here. Which version of AS 3 are you running? – Mike Bonnell Jul 21 '17 at 13:48
  • Android Studio 3 - Canary 7 – MobileMon Jul 21 '17 at 18:07
  • Gotcha, we don't currently test against Canary versions of AS, but will be testing as the releases are more stable. – Mike Bonnell Jul 21 '17 at 19:05
  • This is happening because crashlytics add files to the merged directory, which now contains compiled resources (when AAPT2 is used). @MikeBonnell to fix this you will need to compile the resources before they're added to the merged directory. – Izabela Orlowska Jan 23 '18 at 14:24
  • @IzabelaOrlowska can you share how to "compile the resources before they're added to the merged directory" please? – Weizhi Feb 24 '18 at 02:25
  • It's probably something the crashlytics lib/plugin owners should do. They need to be compiled with AAPT2. See here for more info on AAPT2: https://stackoverflow.com/questions/42082352/how-to-use-aapt2-where-is-the-documentation/47017486#47017486 – Izabela Orlowska Feb 28 '18 at 10:40

1 Answers1

16

Try adding:

android.enableAapt2 = false

to your gradle.properties file.

This enabled me to continue building my project with Crashlytics 2.6.8 on Android Studio 3 beta2.

Shaun
  • 855
  • 9
  • 20