react-native-sdk icon indicating copy to clipboard operation
react-native-sdk copied to clipboard

Can't build Android after upgrading to RN 0.69

Open alexmngn opened this issue 3 years ago • 6 comments

Hello, I have upgraded my project to use the latest version of React Native 0.69 While I can make a debug build without issue, I'm facing an error I cannot resolve when I make a production build on Android

Execution failed for task ':iterable_react-native-sdk:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/Alexis/.gradle/caches/transforms-3/c5bd231533bac8afd0a3a300eabfc673/transformed/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

I have the same issue with my local machine and the CI. Removing the iterable dependency from my project allows me to build. I've tried different versions of iterable, including the latest version 1.3.6.

I've also tried to use different versions of kotlinVersion and androidXCore but it's still failing.

How to reproduce?

Initialise a new React-Native project - will be 0.69.4 as of today

npx react-native init AwesomeProject

Install iterable sdk

npm install @iterable/react-native-sdk

Create an android release build

cd ./android
./gradlew assembleRelease

alexmngn avatar Aug 22 '22 13:08 alexmngn

Thanks for reporting @alexmngn. What is your Android app's targetSDK version? Have you tried updating it?

Ayyanchira avatar Aug 22 '22 17:08 Ayyanchira

This is my gradle config which is the same one as RN 0.69

    buildToolsVersion = "31.0.0"
    minSdkVersion = 21
    compileSdkVersion = 31
    targetSdkVersion = 31

alexmngn avatar Aug 23 '22 07:08 alexmngn

Hi @alexmngn , Have you tried this? ./gradlew app:assembleRelease

Let me know if that helps... Reference: https://stackoverflow.com/a/61932616/6059451

Ayyanchira avatar Aug 24 '22 19:08 Ayyanchira

@Ayyanchira I have just tried to use this command and yes, it does build properly. That's a workaround I can use for now until the versions of the iterable sdk get more in sync with the latest RN. Thanks for this!

alexmngn avatar Aug 25 '22 09:08 alexmngn

@Ayyanchira I was working on fixing this error and just found this answer, thanks bro.

jasonhcgt avatar Nov 07 '22 09:11 jasonhcgt

Ayyanchira

it work for me, thanks

trungls1706 avatar Dec 06 '22 10:12 trungls1706

Hi @alexmngn , Have you tried this? ./gradlew app:assembleRelease

Let me know if that helps... Reference: https://stackoverflow.com/a/61932616/6059451

nice this also work for me

aliabdullahsaleem avatar Jan 08 '24 10:01 aliabdullahsaleem