해당 글에서는 React Native 환경에서 iOS 플랫폼에서 react-native-google-mobile-ads 라이브러리를 설치하고 빌드를 하는 중에 발생하는 오류에 대한 해결방법에 대해 알아봅니다.
1) 문제점
💡 문제점
- react-native-google-mobile-ads 라이브러리를 iOS 플랫폼에서 설치하고 Xcode로 빌드를 하였을 때 아래와 같은 오류가 발생하였습니다. - 안드로이드 내에서는 실행이 잘되지만 iOS내에서만 발생하는 오류로 파악이 되었습니다.
ld: warning: ignoring duplicate libraries: '-lc++' ld: warning: Could not find or use auto-linked library 'swift_Builtin_float': library 'swift_Builtin_float' not found ld: warning: Could not find or use auto-linked library 'swift_errno': library 'swift_errno' not found ld: warning: Could not find or use auto-linked library 'swift_math': library 'swift_math' not found ld: warning: Could not find or use auto-linked library 'swift_signal': library 'swift_signal' not found ld: warning: Could not find or use auto-linked library 'swift_stdio': library 'swift_stdio' not found ld: warning: Could not find or use auto-linked library 'swift_time': library 'swift_time' not found ld: warning: Could not find or use auto-linked library 'swiftsys_time': library 'swiftsys_time' not found ld: warning: Could not find or use auto-linked library 'swiftunistd': library 'swiftunistd' not found ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found Undefined symbols for architecture arm64: "_swift_FORCE_LOAD$_swift_Builtin_float", referenced from: _swift_FORCE_LOAD$swift_Builtin_float$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swift_errno", referenced from: _swift_FORCE_LOAD$swift_errno$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swift_math", referenced from: _swift_FORCE_LOAD$swift_math$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swift_signal", referenced from: _swift_FORCE_LOAD$swift_signal$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swift_stdio", referenced from: _swift_FORCE_LOAD$swift_stdio$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swift_time", referenced from: _swift_FORCE_LOAD$swift_time$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swiftsys_time", referenced from: _swift_FORCE_LOAD$swiftsys_time$GoogleMobileAds in GoogleMobileAds[arm64] 430 "swift_FORCE_LOAD$_swiftunistd", referenced from: _swift_FORCE_LOAD$swiftunistd$_GoogleMobileAds in GoogleMobileAds[arm64] 430 ld: symbol(s) not found for architecture arm64
2) 해결방법
💡 해결방법 - 위에 오류들은 여러 Swift 관련 라이브러리들(swift_Builtin_float, swift_errno, swift_math 등)을 찾을 수 없다는 경고가 표시됩니다. arm64 아키텍처에서 심볼을 찾을 수 없다는 링커 오류가 발생했습니다.
- 결론적으로 해결한 방법은 Xcode의 버전 16 버전으로 업데이트하고 iOS 18으로 업데이트하여서 해당 문제를 해결하였습니다.
1. 해결방법 확인
💡 해결방법 확인
- 기존의 Xcode 15.4 버전을 이용하여서 빌드를 수행하였습니다.
💡 MacOS 버전을 Sequoia 15.3.2 버전으로 업데이트를 수행하고, Xcode 버전을 16 이상 버전으로 업데이트를 수행하였습니다.