react-native-image-sequence icon indicating copy to clipboard operation
react-native-image-sequence copied to clipboard

Android build failing on RN 0.59

Open mrarlloyd opened this issue 6 years ago • 5 comments

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.```

mrarlloyd avatar Apr 30 '19 17:04 mrarlloyd

I'm having this exact problem too. Did you find out more, @mrarlloyd?

alfreddatakillen avatar Jul 15 '19 08:07 alfreddatakillen

+1 having the exact same issue, did anyone manage to solve it?

Zontex avatar Aug 18 '19 13:08 Zontex

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 avatar Sep 24 '19 09:09 koodiohto

@koodiohto thanks, it's working, but when we need more then 28 compieSdkVersion then ?

tarbundiyahitesh21 avatar Jun 09 '20 04:06 tarbundiyahitesh21

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

choibles avatar Sep 22 '20 20:09 choibles