Android build failing on RN 0.59
Getting a build failure for the latest version ^0.6.1 of react-native-image-sequence, using ReactNative 0.59:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-image-sequence:verifyReleaseResources'.
> 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.
/Users/lloyd/development/learner/node_modules/react-native-image-sequence/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/Users/lloyd/development/learner/node_modules/react-native-image-sequence/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/Users/lloyd/development/learner/node_modules/react-native-image-sequence/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
error: failed linking references.```
I'm having this exact problem too. Did you find out more, @mrarlloyd?
+1 having the exact same issue, did anyone manage to solve it?
I was able to solve this by adding to my android/build.gradle under allprojects this:
allprojects{
subprojects {
afterEvaluate {
project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
}
}
}
}
....
@koodiohto thanks, it's working, but when we need more then 28 compieSdkVersion then ?
Hey, so in case other people are struggling with this issue, I've found that it only appears if Proguard is enabled on the android build (to reduce the size of the APK).
To fix it, I actually learned in this issue comment (for Flutter, go figure) that updating the compileSdkVersion in the specific, offending library will fix the issue. Appears that at the time of this comment, react-native-image-sequence is configured to use compileSdkVersion 23.
If you go into your node_modules -> react-native-image-sequence -> android -> build.gradle file and update compileSdkVersion to 28, the ./gradlew assembleRelease call should work.
Obviously less than ideal to alter the imported library, so perhaps package maintainers can update the compileSdkVersion when they get a chance. Until then, this appears to work.
Cheers