React-native-config: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

Created on 15 Mar 2019  路  12Comments  路  Source: luggit/react-native-config

I met this issue when I built signed apk in react native.
My gradle version is 4.10.1 and gradle plugin version is 3.3.2

This is message I got.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevalues-v26values-v26.xml:7: error: resource android:attr/colorError not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevalues-v26values-v26.xml:11: error: resource android:attr/colorError not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevalues-v26values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevalues-v28values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevalues-v28values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2710: error: resource android:attr/fontStyle not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2711: error: resource android:attr/font not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2712: error: resource android:attr/fontWeight not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2713: error: resource android:attr/fontVariationSettings not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2714: error: resource android:attr/ttcIndex not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2795: error: resource android:attr/startX not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2798: error: resource android:attr/startY not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2801: error: resource android:attr/endX not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2804: error: resource android:attr/endY not found.
E:projectsreact_nativeprototype-kazuhidenode_modulesreact-native-cookiesandroidbuildintermediatesresmergedreleasevaluesvalues.xml:2812: error: resource android:attr/offset not found.
error: failed linking references.

Any ideas?

Most helpful comment

That comment helped me to build
https://github.com/facebook/react-native/issues/19239#issuecomment-499310486

All 12 comments

@mobilestar1221 any luck on this? I'm running into it as well after upgrading my project to react-native 0.59

So far, I used to use keytool command line to generate a signed apk.
Instead, I used android studio to build a signed apk and it worked for me.

Anyone have any luck?
Having the same issue when trying to build.

Did you try to build with android studio?

@mobilestar1221 I've tried building with both android studio and through command line, same issue.

Did you try this in android studio?
First, run bundle js server by "react-native start".
In android studio, build/generate signed apk
Here you should create a keystore file and check jar and apk.

Yeah I've tried, I'll keep looking into it but it's still not working.
Thanks for the help though.

I have this error:

Execution failed for task ':app:mergeReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.1-5013011-osx Daemon #1: Unexpected error during compile '/Users/awaisakrammughal/Projects/RN/NRD8/android/app/build/generated/res/react/release/drawable-mdpi/assets_bg.png', attempting to stop daemon.
Exception in thread "ForkJoinPool.commonPool-worker-2" java.lang.IllegalStateException: AAPT Process manager cannot be shut down while daemons are in use

Any update on this one?

@iamawaisakram I fixed the issue you have by the thread below, reducing files to under 2MB. Seems like a different problem from this thread though. Overall, upgrading to gradle 3.4 may fix these issues
https://stackoverflow.com/questions/52712063/build-failing-during-merge-resources-with-android-gradle-plugin-3-3-0/52791720

That comment helped me to build
https://github.com/facebook/react-native/issues/19239#issuecomment-499310486

Was this page helpful?
0 / 5 - 0 ratings