DEV Community

sasurau4
sasurau4

Posted on

2 1

Tips for react-native upgrade to v0.58.4

What is the article

I tried upgrade react-native v0.57.7. to v0.58.4.

This article is the saga of upgrading.

Steps

At first, upgrade react-native to v0.58.4, , react to 16.6.1 and metro-react-native-babel-preset to 0.51.1 by yarn or npm.

You might meet errors when yarn react-native ios or android.

Additional steps here.

For iOS

Mentioned from changelog, you need to link JavaScriptCore.framework as librariy by manual.

It's all done when my use case.

For Android

Upgrading for android is a bit complicated, follow the changelog

I met error of More than one file was found with OS independent path 'lib/x86_64/libjsc.so' same as this issue comment

So, I fixed errors by modifying build.gradle files.

The final result of files are following.

  • android/build.gradle
...
ext {
    ...
    buildToolsVersion = "28.0.2"
    compileSdkVersion = 28
    ...
}
  • android/app/build.gradle
android {
    ...
    packagingOptions {
        pickFirst 'lib/x86_64/libjsc.so'
        pickFirst 'lib/arm64-v8a/libjsc.so'
    }
    ...
}

Conclusion

I hope these tips are helpful for you.
Have a habby react-native developing!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (1)

Collapse
 
evilchis94 profile image
Edgar Vilchis

Thanks for the guide! The packingOptions didn't work for me. I used this github.com/react-native-community/...

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay