react-native-community / upgrade-support

A central community-backed place to request and give help when upgrading your app.
MIT License
261 stars 2 forks source link

UMReactNativeEventEmitter.m errors upgrading to 0.70.6 #216

Open shortdark opened 2 years ago

shortdark commented 2 years ago

Environment

-System:

Things I’ve done to figure out my issue

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

Xcode screenshot of errors

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.

shortdark commented 2 years ago

I thought this was fixed but apparently not. I've just gone through the update helper again and fixed some parts I'd missed.

jessrichmond commented 1 year ago

@shortdark did you ever figure out the solution to this?

walterwootz commented 1 year ago

Same problem here with CPU Intel. Upgrade RN from 0.63.5 to 0.71. Any solutions or workaround?

scinfu commented 1 year ago

Anyone found a solution?

gregdevvv commented 1 year ago

any developments on this issue?

shortdark commented 1 year ago

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.

gregdevvv commented 1 year ago

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.

ntnext commented 1 year ago

@gregdevvv your solution do not work for me, I do not have expo.

AdriBee commented 1 year ago

Same problem here :S

AdriBee commented 1 year ago

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.