react-native-community / upgrade-support

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

Migration from 0.61.2 -> 0.70.1 Error in AppDelegate.mm Cannot initialize a parameter of type 'id<RCTBridgeDelegate>' with an lvalue of type 'AppDelegate *const __strong' #212

Open taylorjosephgriffin opened 2 years ago

taylorjosephgriffin commented 2 years ago

Environment

System: OS: macOS 12.3.1 CPU: (10) x64 Apple M1 Pro Memory: 289.60 MB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.18.1 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.15 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/taylorgriffin/.rvm/gems/ruby-2.6.4/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: javac 12 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.1 => 0.70.1 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found

Things I’ve done to figure out my issue

Upgrading version

0.70.1

Description

Cannot initialize a parameter of type 'id<RCTBridgeDelegate>' with an lvalue of type 'AppDelegate *const __strong'

issue is in the new AppDelegated.mm file.

Reproducible demo

I am not sure explicitly how to reproduce this. This happened on the migration from 0.61.2 -> 0.70.1 (i know im sorry)

HugoGresse commented 1 year ago

I had the same issue, somewhere before I probably forgot to update the AppDelegate.h (header file) Linked to the update in version 0.68.4:

Ref : https://github.com/react-native-community/rn-diff-purge/blob/release/0.68.4/RnDiffApp/ios/RnDiffApp/AppDelegate.h

#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
meiqi1992 commented 1 year ago

same issue ,how to resolve?