Closed grabbou closed 3 years ago
Thanks to everyone who put in effort to get react native to 0.64
I'm not able to try this RC release, for some reason I get the following errors.
@a-eid take a look at the RN Upgrade Helper to find out what you need to change for this release.
Run
rm -rf node_modules && rm -rf package-lock.json && rm -rf ios/Pods && rm -rf ios/Podfile.lock
and then reinstall everything using
npm i && cd ios && pod repo update && pod update && pod install
I've successfully upgraded to 0.64.0-rc.0 in my project without problems and even managed to get hermes running on iOS with a single line of code (thanks to @grabbou !), so everything seems to work fine
EDIT: To everyone that wants to try out 0.64 rc0 and hermes for iOS, this is how you upgrade:
npm i react-native@next
) react
to 17, and metro packages to the newest versions- use_react_native!(:path => config[:reactNativePath])
+ use_react_native!(:path => config[:reactNativePath], :hermes_enabled => true)
@a-eid take a look at the RN Upgrade Helper to find out what you need to change for this release.
Run
rm -rf node_modules && rm -rf package-lock.json && rm -rf ios/Pods && rm -rf ios/Podfile.lock
and then reinstall everything using
npm i && cd ios && pod repo update && pod update && pod install
I've successfully upgraded to 0.64.0-rc.0 in my project without problems and even managed to get hermes running on iOS with a single line of code (thanks to @grabbou !), so everything seems to work fine
A quicker trip to this point would be to install react-native-clean-project
as a dev dependency and setup the following in package.json
:
"scripts": {
"clean": "react-native clean-project-auto && yarn && yarn pod",
"pod": "pod install --repo-update --project-directory=ios"
}
Run yarn clean
when ever you notice some weird behaviour so you can reset the working directory.
As with @a-eid , I'm unable to run the newly-created app on Android. Here's the relevant section from adb logcat
It seems to be unable to find any .so
, including JSCExecutor and LibFBNI's.
As for iOS, building with or without hermes worked well. I did create a PR to react-native's home repo to add some brief instructions to the template's Podfile
. I did encounter an odd warning building for the simulator with hermes:
Unable to run Android app after upgrade with hermes enabled.
Error: E/SoLoader: couldn't find DSO to load: libjscexecutor.so
After upgrade from 0.63.3 to this RC I can't open app on Android. This is log from logcat:
--------- beginning of crash
2020-11-23 22:29:24.494 16152-16241/com.myapp E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: com.myapp, PID: 16152
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: dlopen failed: library "libc++_shared.so" not found result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:896)
at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:725)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:649)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:629)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1024)
at java.lang.Thread.run(Thread.java:929)
I noticed an annoying behavior on iOS:
If I run yarn
and pod install
, the project runs correctly.
But if I run yarn
again, the codegen changes will be lost and the build will fail:
Build input file cannot be found: 'node_modules/react-native/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm'
So every time we run yarn
we need to run pod install
again.
About hermes, it seems to work correctly, but still need to test it on a bigger project.
I wasn't able to run the app. I also had the android issues other people pointed above:
E/SoLoader: couldn't find DSO to load: libjscexecutor.so
E/SoLoader: couldn't find DSO to load: libfbjni.so
E/SoLoader: couldn't find DSO to load: libhermes.so
FATAL EXCEPTION: FlipperEventBaseThread
Reproduction code: https://github.com/brunolemos/react-native-web-monorepo/tree/rn64
Sorry if this is just noise, but when I have had "android total failure to find/load DSO" issues like that, it was of course immediately down to the soloader. You can maybe try downgrading it (it was upgraded for RN64 yes?) sort of like so: https://github.com/invertase/react-native-firebase/blob/bda2d67ddaf7f12ac3143b564e7e94974e8356db/tests/android/app/build.gradle#L118-L123
(that was me solving this problem by upgrading it from a lower version to the one that went in RN63, perhaps a quick test hacking that in from someone reproducing this currently might help isolate things
@mikehardy I had tried resolutionStrategy
to 0.9.0
, just re-tried with 0.8.2
and unfortunately it also didn't have any effect on the error messages. Also tried downgrading/upgrading Flipper. But someone else please try as well.
@mrousavy I'm not upgrading an old project, I'm creating a new one
npx react-native init RN064 --version 0.64.0-rc.0
sudo gem install cocoapods --pre
seems to resolve the pod install
issue.
however it still doesn't compile on ios, I think it's because I'm using xCode 11.5 or something. gonna update & try again.
android compiles fine but doesn't actually launch the app, it exists immediately ..
I just looked at the changes between RN0.63.3 and RN0.64.0-rc.0 and figured out the minSDKVersion
for android is upgraded from 16 to 21. it's a big change I think and I couldn't find its reason in other related threads. it seems this change is not even mentioned in the first commit of the current issue
@SaeedZhiany you are correct, I've added that plus the Node bump to the highlights and also linked the draft PR for the changelog so that folks can more easily check the changes for themselves.
Awesome work on this! I'm really excited for Hermes running smoothly on iOS devices.
In debug builds, everything runs fine and stable on Hermes. I noticed that any console.log
statements aren't being printed to the metro bundler console anymore đ€ Is this disabled per design?
I tried this version in microsoft/react-native-test-app and got this build error in Xcode:
I can't find the file either if I do find . -name FBReactNativeSpec.h
. Am I missing some codegen step here? I didn't hit any issues during pod install
.
% pod --version
1.10.0
Another observation worth surfacing here. I was checking the upgrade-helper instructions for 0.64 and noticed that it expects the NDK in the android build gradle:
ndkVersion = "20.1.5948944"
Questions: 1) Why is it present? If this is what we expect from a DX perspective we need to add documentation around adding the NDK
2) This is a different version from the one we use in core for building react-native - we use 19. I'm concerned this misalignment is going to create troubles.
cc @dulmandakh @alloy @fkgozali
@kelset It's required by the recent version of gradle plugin. The NDK version must be specified even that you do not really use it.
@kelset It's required by newer version of gradle. A version must be specified even that you do not really use it.
Thanks for the insight @sunnylqm, could you send me the link to the documentation of gradle that says so? I wonder why the version added is neither latest (so 21) nor the one we use (19).
@kelset we use NDK version 20. its in https://github.com/react-native-community/docker-android
One of the discussion https://github.com/facebook/react-native/pull/29987 Related gradle plugin doc https://developer.android.com/studio/releases/gradle-plugin#default-ndk-version though it's not clearly explained
@tido, make sure you have this in your Podfile
.
pre_install do |installer|
codegen_pre_install(installer)
end
This script is responsible for generating that missing file.
This script is responsible for generating that missing file.
@grabbou: Thanks! I don't know how I managed to miss it while staring at the upgrade helper.
Hiding a bunch of comments that have been addressed.
(for NDK, it looks like I misunderstood which version we were supposed to use - NDK 20 is for the time being default for everything RN related - thanks @dulmandakh & @sunnylqm for the links and explanations)
@grabbou: The script fails if you're not in the correct path when invoking pod install
:
example % pod install --project-directory=ios
Auto-linking React Native module for target `ReactTestApp`: ReactTestApp-DevSupport
Analyzing dependencies
Downloading dependencies
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module '/~/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
[!] An error occurred while processing the pre-install hook of the Podfile.
Could not generate Native Module schema
But if I navigate into ios
first, it will succeed:
example % cd ios
ios % pod install
Auto-linking React Native module for target `ReactTestApp`: ReactTestApp-DevSupport
Analyzing dependencies
Downloading dependencies
Generating Pods project
NOTE
`ReactTestApp.xcodeproj` was sourced from `react-native-test-app`
All modifications will be overwritten next time you run `pod install`
Integrating client project
Pod installation complete! There are 54 dependencies from the Podfile and 45 total pods installed.
In the error case, it's looking for react-native-codegen
in the parent folder's node_modules
instead of current.
Based on Upgrade helper, why devDependencies ( babel
, eslint
) not updated...
@a-eid do you have Swift code in your Project? I have a notification service extension written in Swift, and that's causing the same problems that you've posted for me right now. On Debug it works fine. I think this is an architecture/deployment target issue đ€
@tido64 something that could be fixed in a PR, by default, it runs from within iOS
folder hence this case is probably not well supported.
Would you mind tweaking the Ruby script?
@grabbou: I can try when I have some free cycles.
Regarding Android, I'm hitting the same issues as others have in this thread. Seems like some .so
files are missing:
android % unzip -lv app/build/outputs/apk/debug/app-debug.apk | grep '\.so'
9668 Defl:N 3108 68% 01-01-1981 01:01 b271447e lib/x86/libimagepipeline.so
13704 Defl:N 7377 46% 01-01-1981 01:01 def5f9b3 lib/x86/libnative-filters.so
3669668 Defl:N 1659491 55% 01-01-1981 01:01 df43bfbe lib/x86/libhermes.so
595460 Defl:N 231829 61% 01-01-1981 01:01 62967281 lib/x86/libnative-imagetranscoder.so
android %
We're investigating that right now and will try to publish a fix really soon. Meanwhile, feel free to experiment with iOS a bit more đȘ
@grabbou I've updated my comment above (https://github.com/react-native-community/releases/issues/214#issuecomment-732802130) to add more details, that's everything I noticed so far. Let me know if you want me to test anything. đȘ In the meantime I'd like to thank you guys for your hard work while still being quick in responses đ
Would you mind tweaking the Ruby script?
@grabbou: https://github.com/facebook/react-native/pull/30469
The android version runs perfectly in debug mode using android studio emulator. However, the release version of the apk crashes immediately when launched.
npx react-native init RN064 --version 0.64.0-rc.0
Android version: 11
System: OS: Windows 10 CPU: (8) x64 Intel(R) Core(TM) i5 Memory: 669.34 MB / 7.92 GB Binaries: Node: 14.15.0 Yarn: 1.22.5 npm: 6.14.7 Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: AllowDevelopmentWithoutDevLicense: Enabled AllowAllTrustedApps: Enabled Versions: 10.0.18362.0 IDEs: Android Studio: Version 4.0.0.0 Languages: Java: javac 12 Python: 3.8.3 npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.0-rc.0 => 0.64.0-rc.0
Hopeful fix for Android: https://github.com/facebook/react-native/pull/30470, once confirmed to work, we will quickly release rc.1
(even today).
0.64.0-rc.1 shipped with a fix for Android and CLI bump to 5.0.0
(that we have missed before). No other changes. I just built fresh new app with Android. Happy testing!
@a-eid, we have been testing this release with Xcode 12 and if it fixed the issues for you, here's the answer! I'd recommend upgrading to be 100% sure.
New JSX transform is not on by default. React Must be in scope. Is that intentional or should be fixed?
@grabbou IOS builds fine after upgrading to xCode 12.2
,
android builds fine but exists immediately after launch.
Edit:
now android is working fine for me.
@a-eid could you try if iOS works with Hermes enabled in Release mode for you?
I see that there a new RC version, I will be testing that,
@mrousavy Hermes was working on IOS just fine, I have not tested on release mode, I'll try that out today.
android is building & working fine for me now. ( dev mode ).
IOS as well.
android working well with hermes.
IOS working well with heremes.
@mrousavy IOS doesn't build in release mode with hermes enabled.
IOS doesn't build in release mode with hermes disabled. ( different error that the above one. )
@grabbou So I've tried to build android, but my builds failed because the turbo module JSI JNI .so
files were generated more than once:
- More than one file was found with OS independent path 'lib/x86_64/libturbomodulejsijni.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
I temporarily fixed this, by adding this:
android {
// ...
+ packagingOptions {
+ pickFirst '**/*.so'
+ }
// ...
}
in my app/build.gradle
(under the android {
section). Since I'm not sure if that has any unwanted side-effects, I don't really feel comfortable with shipping an app like this, but it builds fine for now.
(I couldn't get the app to actually run due to errors with reanimated - working on that! https://github.com/software-mansion/react-native-reanimated/pull/1469)
I'm trying to upgrade to 0.64rc-0, but i have this error. Do other people have it too?
Based on Upgrade helper, why devDependencies ( babel, eslint) not updated...
@Bardiamist I checked in the repo and it seems that those versions are in line with the rest of the codebase; maybe you could try to do a PR to update the ones in the template and we can check with FB if that's ok for them?
@lorenzoangelini have you done all the steps @mrousavy mentioned in his comment here?
@kelset yes i followed every step but i get the same error. Are there any changes to xcode that I may not have made?
Based on Upgrade helper, why devDependencies ( babel, eslint) not updated...
@Bardiamist I checked in the repo and it seems that those versions are in line with the rest of the codebase; maybe you could try to do a PR to update the ones in the template and we can check with FB if that's ok for them?
@lorenzoangelini one way to be sure, is to install your package in a freshly installed RN0.64.1
project.
@lorenzoangelini looks like the issue is caused by lottie-react-native so I'd try to interface with the maintainers of that library and find out if on a fresh project that same issue is present (rc.1 + lottie). It could be that lottie needs to update something on their side.
Hi @kelset , i created a new fresh project, and i installed "lottie-ios": "3.1.8" and "lottie-react-native": "^3.5.0", and i reproduced the bug.
Getting same build error with lottie-ios
on rc.0
as @lorenzoangelini. This happens with Hermes enabled only.
No error in building on real device or simulator on IOS or Android i successfully migrate the 0.63.3 to 0.64.0-rc.1 (with Hermes also) but when i want to do an Archive on any device (arm64) to publish on Testflight i got this error :
File /Users/Polyrion/Library/Developer/Xcode/DerivedData/greenapp-esyrbbmdczgfjnajidahxcpqtjox/Build/Intermediates.noindex/ArchiveIntermediates/greenapp/BuildProductsPath/Release-iphoneos/GreenApp.app/main.jsbundle does not exist. This must be a bug with'
error: File /Users/Polyrion/Library/Developer/Xcode/DerivedData/greenapp-esyrbbmdczgfjnajidahxcpqtjox/Build/Intermediates.noindex/ArchiveIntermediates/greenapp/BuildProductsPath/Release-iphoneos/GreenApp.app/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
Not sure if this comment will make a difference as I understand why you want to remove support for the older versions of Android.
We develop apps for emerging markets. In some countries in Africa, we still have thousands of users in Android 4.4 (around 4% of the user base in some apps). If you remove support for older SDK, we and everyone else developing for emerging markets won't be able to upgrade and will be stuck in 0.63 for the foreseeable future.
For reference, here's the penetration for Africa: https://gs.statcounter.com/android-version-market-share/mobile-tablet/africa
Edit: I propose RN keeps support for SDK >= 4.4, I think it's a good balance between supporting devices in emerging markets and removing old APIs
Current latest release: v0.64.0-rc.4
Highlighted Changes
profile-hermes
CLI command for converting Hermes tracing profile to Chrome formatPlease see the changelog PR for more details.
Work Required
shelljs
has been moved from the rootpackage.json
intorepo-config/package.json
(https://github.com/facebook/react-native/commit/f3930a93d5cf5f19058b0bfe453c7b9324eb8552), causingpublish-npm.js
script to fail. I have temporarily installed that package on the CircleCI, but would love additional background on the original commit and whether we can safely move it back to the root. https://github.com/facebook/react-native/pull/30472Already resolved
- [X] [Update documentation](https://github.com/facebook/react-native-website/projects/1) [@simek] - [x] facebook/react-native#29914 - [x] React 17 support (landed) - [x] facebook/react-native#29882 - [x] facebook/react-native#30177 - [x] facebook/react-native@a7c1c5a - [x] Bump CLI to latest - [x] Migrate warnings in index.js to point to new lean core repos (https://github.com/facebook/react-native/pull/30422) - [x] The `hermes-engine` pod has no version constraints specified, which should probably happen in the `React-Core.podspec` file and lock it with similar version constraints as the one applied to the Android version in `package.json`. Fixed by https://github.com/facebook/react-native/pull/30432 - [x] The newly introduced codegen invocation step in the iOS Podfile is failing, as the dependencies of the `react-native-codegen` package have not been installed. See output [here](https://gist.github.com/alloy/2d3b3285b76666234be62086f9d4b8b6). In progress PR here https://github.com/facebook/react-native/pull/30449 - [x] Trying to build a newly created Android app fails when checking the dynamic libraries for duplicate classes. See output [here](https://gist.github.com/alloy/a9f2f4102705bad0b2c53407edd2bd89). Fixed by https://github.com/facebook/react-native/pull/30452 - [x] https://github.com/facebook/react-native/pull/30470 - [x] The new CLI has a minor regression when using a local template dir, now you need to specify the `file://` protocol to resolve that [@grabbou] (added note to changelog, this is expected) - [x] https://github.com/facebook/react-native/commit/d85d5d2e1974b463318e4c86da29a5ccdd60a977 - [x] facebook/react-native#30489 (+ make sure to update the changelog as [per this comment](https://github.com/facebook/react-native/pull/30489#pullrequestreview-539864503)) - [x] Bump to Hermes 0.7.2 (facebook/hermes#373) (https://github.com/facebook/react-native/pull/30561) - [x] Add instructions on how to enable Hermes in the default application https://github.com/facebook/react-native/pull/30461 - [x] Running `pod install` outside of `ios` folder will fail facebook/react-native#30469 (temporary solution, will be fixed by facebook/react-native#30449) - cherry picked https://github.com/facebook/react-native/commit/c901c1fbce080c6e9b6ed56dbccaa7f2fa0571b2, https://github.com/facebook/react-native/commit/5eee2f2bc01184481a663453648ab15d1d295f4d and https://github.com/facebook/react-native/commit/b61aaa1545b3308bda5ade169204f875ba417f01 for the record. - [x] ~~Submitting Hermes enabled application to AppStore will fail validation https://github.com/facebook/hermes/issues/420~~ This isn't a release blocker; this issue is triggered when somebody specifies a higher deployment target than the default and can be solved by the user as shown [here](https://github.com/facebook/hermes/issues/420#issuecomment-736875843). - [x] https://github.com/facebook/react-native/pull/30571 - [x] Building React Native application in release mode will cause an issue with Xcode 12 facebook/react-native#29984 (here [is a workaround](https://github.com/facebook/react-native/issues/29984#issuecomment-696328815)) https://github.com/facebook/react-native/pull/30543 - [x] facebook/react-native#30495 (regression) - [x] Building with Hermes in Release mode (or with "build active architecture" set to false) causes "Thread-local storage is not supported for the current target" in "folly/synchronization/Rcu.cpp:17:10:" and happens while building for "i386". https://github.com/facebook/react-native/pull/30592 - [x] Resolve issues highlighted in the comment https://github.com/react-native-community/releases/issues/214#issuecomment-758203239 - [x] https://github.com/facebook/react-native/commit/811ccec74e5b898e9304f86f85f390908f8d317f - [x] https://github.com/facebook/react-native/commit/7a9e4ba4e9ae02ab8a0fe0f67ceefd5d675b9dbf - [x] https://github.com/facebook/react-native/commit/f312e5ba84afcddaac326ed62eaf4e00c00cf480 - [x] https://github.com/facebook/react-native/commit/f45cb60e560d21be134aa808bd105e0394ba1fd5 - [x] Issue stripping symbols on Android https://github.com/react-native-community/releases/issues/214#issuecomment-758425571 - [x] Some users are experiencing issues with CodeGen on iOS due to missing files https://github.com/react-native-community/releases/issues/214#issuecomment-766436299Hopeful Dates
We can never commit to the dates involved in a release as many things are out of our control. However, we are thinking about these rough dates for this release.