How to succeed React Native upgrade 0.68.5 to 0.70.6
See original GitHub issueNew 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
- public repository: https://github.com/pass-culture/pass-culture-app-native
- upgrade guide https://react-native-community.github.io/upgrade-helper/?from=0.68.5&to=0.70.6
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:
.flowconfig
does not exist in our project while it isMODIFIED
in upgrade helper: why? <- it seems we don’t need it.node-version
as beenADDED
while we use.nvmrc
to set our version: do we need both ? <- it is unclear if.nvmrc
is enoughandroid/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 ?android/app/src/main/java/com/rndiffapp/newarchitecture/MainApplicationReactNativeHost.java
isMODIFIED
but does not exist in our project: why? <- it seems we can ignoreandroid/app/src/main/jni/Android.mk
isDELETED
but does not exist in our project: why? <- it seems we can just add it (or ignore?)android/app/src/main/jni/CMakeLists.txt
isADDED
, but we don’t even have aandroid/app/src/main/jni
folder: what should we do? <- it seems we can just add it (or ignore?)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 alsoMODIFIED
but from non existingandroid/app/src/main/jni
folder: what should we do? <- it seems we can just ignoreeandroid/settings.gradle
add two lines for hermes in aif
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 ignoredios/Podfile
ours as many difference than versionfrom
andto
, 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 anyuse_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
ios/RnDiffApp/AppDelegate.mm
: we don’t have this file, we have ourAppDelegate.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:
- 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 addingandroid/app/src/main/java/com/rndiffapp/newarchitecture/MainApplicationReactNativeHost.java
with messageThis file is only required for the New Architecture setup.
- https://reactnative.dev/docs/new-architecture-intro (doc new architecture state it is experimental and I assume we don’t need those fail)
- All
jni
files are also written experimental
- 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 architectureandroid/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:
- Created 9 months ago
- Comments:10 (4 by maintainers)
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.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 witherror: cannot find symbol BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;