upgrade-support
upgrade-support copied to clipboard
UMReactNativeEventEmitter.m errors upgrading to 0.70.6
Environment
-System: * OS: macOS 13.0.1 * CPU: (8) arm64 Apple M2 * Memory: 62.39 MB / 8.00 GB * Shell: 5.8.1 - /bin/zsh
- Binaries:
- Node: 18.11.0 - /opt/homebrew/bin/node
- Yarn: 1.22.19 - /opt/homebrew/bin/yarn
- npm: 8.19.2 - /opt/homebrew/bin/npm
- Watchman: 2022.10.10.00 - /opt/homebrew/bin/watchman
- Managers:
- CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
- SDKs:
- iOS SDK: *Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
- Android SDK: Not Found
- IDEs:
- Android Studio: 2021.3 AI-213.7172.25.2113.9014738
- Xcode: 14.1/14B47b - /usr/bin/xcodebuild
- Languages:
- Java: 11.0.16.1 - /opt/homebrew/opt/openjdk@11/bin/javac
- npmPackages:
- @react-native-community/cli: Not Found
- react: 18.1.0 => 18.1.0
- react-native: 0.70.6 => 0.70.6
- react-native-macos: Not Found
- npmGlobalPackages:
- react-native: Not Found
Things I’ve done to figure out my issue
- [Y] I used upgrade-helper to do my upgrade.
I have also been fixing errors since upgrading.
Upgrading version
0.70.6
Description
I'm attempting to upgrade a react native app from 0.64.2 to 0.70.6 but I am getting errors when I try to build in Xcode, see screenshot.
Full path:
/Users/me/code/my-app/node_modules/@unimodules/react-native-adapter/ios/UMReactNativeAdapter/Services/UMReactNativeEventEmitter.m
It appears to be connected to unimodules. The thing I know that has changed with unimodules is that I've been through and updated maven to maven-publish, and changed the uploadArchives block to:
publishing {
repositories {
maven {
url = uri("${rootProject.projectDir}/maven-repo")
}
}
}
The code in UMReactNativeEventEmitter.m
@property (nonatomic, weak) UMModuleRegistry *moduleRegistry;
is declared in RCTBridgeModule.h like this:
@property (nonatomic, weak, readwrite) RCTModuleRegistry *moduleRegistry;
At the bottom of UMReactNativeEventEmitter.m, it doesn't like the use of the undeclared modifier _moduleRegistry, here is the code in question...
# pragma mark - UMModuleRegistryConsumer
- (void)setModuleRegistry:(UMModuleRegistry *)moduleRegistry
{
_moduleRegistry = moduleRegistry;
}
Does anyone have any idea what is happening here and how to fix it?
Reproducible demo
Upgrading from 0.64.2 to 0.70.6.
I thought this was fixed but apparently not. I've just gone through the update helper again and fixed some parts I'd missed.
@shortdark did you ever figure out the solution to this?
Same problem here with CPU Intel. Upgrade RN from 0.63.5 to 0.71. Any solutions or workaround?
Anyone found a solution?
any developments on this issue?
I ended up assuming I'd done something wrong and starting over. Instead of using the upgrade helper I believe I just did the minimum to get it working.
I figured out how to avoid these problems if you have expo in your package,json: to do so make sure to remove all the expo modules from the package then npm install all libraries, and lastly install expo modules and all the expo mods you need . For some reason any package installed after the expo modules will once again break the build.
@gregdevvv your solution do not work for me, I do not have expo.
Same problem here :S
Alright I think I got it solved doing the following:
yarn remove react-native-unimodules (I use yarn on my app)
I think react native now includes the unimodules and the package is deprecated (https://www.npmjs.com/package/react-native-unimodules) . It was creating these libraries conflicts at least on my side. Taking that out fixed the error and successfully built it.
Note that I also had problems with Firebase (after fixing the error on this post) and the way to solve that one would be to also take out the expo-firebase-analytics and installing this one: https://docs.expo.dev/versions/v46.0.0/sdk/firebase-analytics/#additional-configuration-for-ios
And you may also face a small problem with the Noop-file.swift. That one is just to place an empty file inside the ios folder.
There will probably be more dependencies problems depending on what you use. I recommend installing libraries in chuncks and identifying which ones are the broken ones.
I hope this helps someone else. It is been a tough one to tackle.
