react-native-naver-map: arm64 (m1 mac) IOS Simulator build failed

Version of react-native-naver-map libraries

0.0.66

Version of react-native

0.66.4

Platforms you faced the error (IOS or Android or both?)

IOS

Expected behavior

IOS 시뮬레이터 빌드 성공이 되어야 합니다.

Actual behavior

`Undefined symbols for architecture x86_64: “OBJC_CLASS$_FlipperKitNetworkPlugin”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_SKIOSNetworkAdapter”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_FlipperKitReactPlugin”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_SKDescriptorMapper”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_FlipperClient”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_FlipperKitLayoutPlugin”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_RCTBridge”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_RCTBundleURLProvider”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_RNSplashScreen”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_FKUserDefaultsPlugin”, referenced from: objc-class-ref in AppDelegate.o “OBJC_CLASS$_RCTRootView”, referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

objc[7989]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f5adf7f0) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1111b42c8). One of the two will be used. Which one is undefined. objc[7989]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1f5adf840) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1111b4318). One of the two will be used. Which one is undefined. ** BUILD FAILED **

The following build commands failed: Ld /Users/{user_name}/Library/Developer/Xcode/DerivedData/app-axzhzchqkfykidbfhqumdsnwaosn/Build/Products/Debug-iphonesimulator/app.app/app normal (in target ‘app’ from project ‘app’) (1 failure)`

Tested environment (Emulator? Real Device?)

IOS 시뮬레이터 iPhone 13 IOS 15.0

Screen Shot

X


IOS 시뮬레이터에서 동작하지 않지만 실제기기에서는 잘 동작합니다.

실제기기: iPhone Xs IOS 15.2.1

About this issue

Most upvoted comments

m1 맥에서 시뮬레이터, 아이폰 빌드 방법입니다.


excluded1

  • xcode에서 YourProjectName 선택 → Build Settings 탭 선택→ 좌측 컬럼 PROJECT 선택 -> All, Combined 선택 → Excluded Architectures 하위의 Any iOS Simulator SDKarm64 입력

excluded2

  • xcode에서 YourProjectName 선택 → Build Settings 탭 선택→ 좌측 컬럼 TARGETS 선택 -> All, Combined 선택 → Excluded Architectures 하위의 Any iOS Simulator SDKarm64 입력

excluded3

  • xcode에서 Pods 프로젝트 선택 → Build Settings 탭 선택→ 좌측 컬럼 PROJECT 선택 -> All, Combined 선택 → Excluded Architectures 하위의 Any iOS Simulator SDKarm64 입력

podfile

pod 'NMapsMap','3.10.1' # 버전 3.10.1 명시

이제 기존 pods 폴더 및 lock 파일을 삭제하고 새로 인스톨하면 시뮬레이터, 아이폰에서 빌드됩니다.

$ cd /your/project/root/path/ios

$ rm -rf Pods/
$ rm Podfile.lock

$ pod install --repo-update

$ cd /your/project/root/path

# build for simulator
$ yarn ios

# build for physical device using ios-deploy https://stackoverflow.com/a/41632929 
$ yarn ios --device="your-iPhone-name"

xcode에서 빌드해도 잘 됩니다.


테스트환경은 다음과 같습니다.

  • 맥북프로 m1
  • xcode Version 13.2.1 (13C100)
  • 시뮬레이터 Version 13.2.1 (13C100)
  • 아이폰X Version 15.1

22년 4월 4일 기준으로 3.14.2 버전은 위 오류와 동일하게 나와서 빌드 실패하구요. 3.14.1 버전은 빌드 가능가능했습니다.

  • 기록을 위해 남깁니다. -

현재 3.15.0에서 apple silicon arch 지원 가능하게되었습니다

@solidchu @yunyeop 두 분처럼

pod 'NMapsMap','3.10.1'

을 명시하는 경우엔 m1에서 아이폰 기기(iphone X)로 빌드됩니다. (시뮬레이터에선 안 되고요 ㅠㅠ) 특히 버전을 3.10.1로 정확하게 명시한 경우만 됐습니다. NMapsMap 3.14.1이 최신 버전인 것 같은데 이 버전에선 안 되었습니다.

조만간 좋은 해결책이 나오길 ㅠㅠ

@nunnu1028 Pods 폴더, podfile.lock, pod 캐시 삭제 이렇게 한번 모두 시도해보시겠어요?

3.14.1 버전으로 변경 후, 다시 따라하여 빌드에 성공했습니다. 감사합니다.

M1에서 3.15.0 빌드 성공하신분 계신가요? 저는 여전히 같은 에러 발생하면서 안됩니다

amd64 -> arm64??

저두 시뮬에선 에러 발생합니다 ㅠㅠ 도움이 되어서 다행이네요!

위의 예시로 보내 드린 파일 보니, Podfile에서 아래와 같이 버전을 명기 하여 주셔서 그대로 버전을 명기하여 Pod install 다시 하고 빌드하니, 잘 작동합니다.(아직 시뮬레이터는 동일한 에러 발생합니다.)

pod ‘NMapsMap’,‘3.10.1’

도움 주셔서 감사합니다.