If you are trying to run an application on an M1 chip Mac, you may come across the following error. You may also come across it while porting your app onto a different machine.
objc: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x2179a78b0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10608c2c8). One of the two will be used. Which one is undefined.
objc: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x2179a7900) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10608c318). One of the two will be used. Which one is undefined.
You don’t need to explicitly exclude arm64 architecture in the ios project or make changes to the Post_Install script. Just do one thing and it will take care of the rest:
1. Replace 5.0 to 5.2 in the following block of your main ios project.pbxproj file.
LIBRARY_SEARCH_PATHS = ( "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", "\"$(inherited)\"", );
2. cd ios && pod install
It essentially makes the following changes besides updating cocoa pods version and checksum in podfile:
run npx react-native run-ios and it should work now.