Skip to content

How to succeed React Native upgrade 0.68.5 to 0.70.6 #35588

Description

@kopax-polyconseil

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: #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: (PC-15161) build(deps): bump react-native to 0.68.2 pass-culture/pass-culture-app-native#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: (BSR) fix(build): bump react native patch version to fix android build pass-culture/pass-culture-app-native#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: pass-culture/pass-culture-app-native#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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions