question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to succeed React Native upgrade 0.68.5 to 0.70.6

See original GitHub issue

New Version

0.70.6

Old Version

0.68.2

Build Target(s)

iOS/Android

Output of react-native info

info Fetching system and libraries information...
System:
    OS: Linux 5.8 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
    Memory: 2.53 GB / 15.30 GB
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 14.13.0 - ~/.nvm/versions/node/v14.13.0/bin/node
    Yarn: 1.22.15 - ~/.yarn/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v14.13.0/bin/npmhttps://github.com/pass-culture/pass-culture-app-native/pull/4045
    Watchman: 20210124.162314.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 26, 27, 28, 29, 30, 31, 32, 33
      Build Tools: 28.0.2, 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
      System Images: android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_231 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.5 => 0.68.5 
  npmGlobalPackages:
    *react-native*: Not Found

Issue and Reproduction Steps

Hello, since we are stuck succeeding our iOS simulator build within GitHub action due to error Library not loaded: @rpath/hermes.framework/hermes using react native 0.68.5 (issue: https://github.com/facebook/react-native/issues/35536 , error log: https://gist.github.com/kopax-polyconseil/cd31322d8d71b664a0c965be7a1607e0), our organization as no other choice than trying (for the second time) to perform the react-native upgrade: according to changelog and documentation hermes/ruby become more stable in futur version.

As this is our second attempt, we are seeking help. The upgrade guide differ in many points with our current application, this is the list:

  1. .flowconfig does not exist in our project while it is MODIFIED in upgrade helper: why? <- it seems we don’t need it
  2. .node-version as been ADDED while we use .nvmrc to set our version: do we need both ? <- it is unclear if .nvmrc is enough
  3. android/app/src/main/java/com/rndiffapp/MainActivity.java does not look like ours have big differance from your 0.68.5 version of upgrade guide and must be like version 0.70.6: How do we upgrade ?
  4. android/app/src/main/java/com/rndiffapp/newarchitecture/MainApplicationReactNativeHost.java is MODIFIED but does not exist in our project: why? <- it seems we can ignore
  5. android/app/src/main/jni/Android.mk is DELETED but does not exist in our project: why? <- it seems we can just add it (or ignore?)
  6. android/app/src/main/jni/CMakeLists.txt is ADDED, but we don’t even have a android/app/src/main/jni folder: what should we do? <- it seems we can just add it (or ignore?)
  7. android/app/src/main/jni/MainApplicationModuleProvider.cpp, android/app/src/main/jni/MainApplicationModuleProvider.h, android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp, android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h, android/app/src/main/jni/MainComponentsRegistry.cpp are also MODIFIED but from non existing android/app/src/main/jni folder: what should we do? <- it seems we can just ignoree
  8. android/settings.gradle add two lines for hermes in a if block we don’t have but exist in version from and to: what should we do? <- it seems we can just add and it will be ignored
  9. ios/Podfile ours as many difference than version from and to, what should we do? <- it seems we can just take all change
  • We do not have :fabric_enabled => flags[:fabric_enabled], <- it seems we can just add it
  • We use flipper for debugging, but the note state that if we have use_frameworks! enabled it will not work, looking at our repo, I can’t find any use_frameworks! <- it seems we can just add it
  • What is under the addition of flipper (# An absolute path to your application root.), with line :app_path => "#{Pod::Config.instance.installation_root}/.." seems to exist in version from, but not in our, what should we do? <- it seems we can just add it
  • After modification of mac_catalyst_enabled, we should have a line __apply_Xcode_12_5_M1_post_install_workaround that we don’t have. <- it seems we can just add it
  1. ios/RnDiffApp/AppDelegate.mm : we don’t have this file, we have our AppDelegate.m which is totally different: what should we do? <- it seems we can just ignore

This is the analysis we have done to justify those difference:

Our last 2 previous upgrade:

  1. from 0.66.0 à 0.68.2 (PR: https://github.com/pass-culture/pass-culture-app-native/pull/3086)
  • https://react-native-community.github.io/upgrade-helper/?from=0.66.0&to=0.68.2 is adding android/app/src/main/java/com/rndiffapp/newarchitecture/MainApplicationReactNativeHost.java with message This file is only required for the New Architecture setup.
  • All jni files are also written experimental
  1. from 0.68.2 à 0.68.5 due to android upgrade bug (PR: https://github.com/pass-culture/pass-culture-app-native/pull/3880)

This is how we are trying so far:

$ npx react-native upgrade
warn Package color-alpha has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/color-alpha/package.json
warn Package react-instantsearch-hooks has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/react-instantsearch-hooks/package.json
warn Package @testing-library/user-event has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/@testing-library/user-event/package.json
warn Package @types/uuid has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/@types/uuid/package.json
warn Package postcss-normalize has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/postcss-normalize/package.json
warn Package postcss-preset-env has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/postcss-preset-env/package.json
warn Package wdio-chromedriver-service has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/wdio-chromedriver-service/package.json
warn Package wdio-geckodriver-service has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/wdio-geckodriver-service/package.json
warn Package wdio-safaridriver-service has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/wdio-safaridriver-service/package.json
info No version passed. Fetching latest...
info Fetching diff between v0.68.5 and v0.70.6...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
  - .flowconfig
  - App.js
  - android/app/src/main/java/com/passculture/newarchitecture/MainApplicationReactNativeHost.java
  - android/app/src/main/jni/Android.mk
  - android/app/src/main/jni/MainApplicationModuleProvider.cpp
  - android/app/src/main/jni/MainApplicationModuleProvider.h
  - android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp
  - android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h
  - android/app/src/main/jni/MainComponentsRegistry.cpp
  - ios/.xcode.env
  - ios/PassCulture/AppDelegate.mm
error Excluding files that failed to apply the diff:
  - .gitignore
  - .ruby-version
  - Gemfile
  - android/app/build.gradle
  - android/app/src/main/java/com/passculture/MainActivity.java
  - android/build.gradle
  - android/gradle/wrapper/gradle-wrapper.jar
  - android/settings.gradle
  - ios/.xcode.env
  - ios/Podfile
  - ios/PassCulture.xcodeproj/project.pbxproj
Please make sure to check the actual changes after the upgrade command is finished.
You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.68.5&to=0.70.6
info Installing "react-native@0.70.6" and its peer dependencies...
info Running "git status" to check what changed...
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   .node-version
	new file:   android/app/src/main/jni/CMakeLists.txt
	modified:   android/gradle/wrapper/gradle-wrapper.properties
	modified:   package.json
	modified:   yarn.lock

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	ios/.xcode.env

success Upgraded React Native to v0.70.6 🎉. Now you can review and commit the changes

Excluding files that failed to apply the diff:

  • .gitignore: difficulty easy -> fixed ✔️
  • .ruby-version: difficulty easy -> fixed ✔️
  • Gemfile: difficulty easy -> fixed ✔️
  • android/app/build.gradle: medium -> fixed ⚠️ <- it seems we don’t need to do change if we don’t enable new architecture
  • android/app/src/main/java/com/passculture/MainActivity.java: difficulty easy -> fixed ✔️
  • android/build.gradle: difficulty easy -> fixed ✔️
  • android/gradle/wrapper/gradle-wrapper.jar: difficulty easy -> fixed ✔️
  • android/settings.gradle: difficulty easy -> fixed ✔️
  • ios/.xcode.env: difficulty easy -> fixed ✔️
  • ios/Podfile: difficulty easy -> fixed ✔️
  • ios/PassCulture.xcodeproj/project.pbxproj: difficulty easy -> fixed ✔️

The pull request: https://github.com/pass-culture/pass-culture-app-native/pull/4045

So far, we aren’t able to succeed the upgrade build. Where can we find some help and expert? Is this the right place to ask question?

Thank you!

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cortinicocommented, Dec 8, 2022

it needs we have to go back in previous upgrade. And add all those files first

You don’t need to go back. You can get the build.gradle file from the new app template and diff with what you have locally.

1reaction
cortinicocommented, Dec 8, 2022
  • android/app/build.gradle: medium -> fixed ⚠️ <- it seems we don’t need to do change if we don’t enable new architecture

That’s not correct. You need to apply all the changes inside the android/app/build.gradle regardless of you using the New Architecture or not. That’s also the reason why your Android app is failing to build with error: cannot find symbol BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to succeed React Native upgrade 0.68.5 to 0.70.6 - GitHub
A framework for building native applications using React - How to succeed React Native upgrade 0.68.5 to 0.70.6 · facebook/react-native@6fa51e0.
Read more >
Upgrading to new versions - React Native
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a ......
Read more >
How to upgrade react-native version from 0.68.0 to latest ...
Then do the: npm install, cd ios, pod install, -- then do the : npx react-native upgrade or else you can define specific...
Read more >
React Native Upgrade Helper
React Native Upgrade Helper logo ... What's your current react-native version? 0.70.6. To which version would you like to upgrade? 0.71.0-rc.5.
Read more >
react-native | Yarn - Package Manager
if you are an iOS developer, you'll need to manually link JavaScriptCore.framework when upgrading; this can be done via Xcode, and following the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found