react-native-naver-map/issues: building for iOS Simulator-x86_64 but attempting to link with file built for unknown-unsupported file format

Maliethy·2021년 4월 7일
0

React-Native Error

목록 보기
13/15
post-thumbnail

1. issue

react-native-naver-map 라이브러리를 사용하는 과정에서 ios build가 발생했다.

처음 라이브러리를 설치할 때

npm install react-native-nmap --save

를 하면 dependency 오류가 발생하여 -force로 강제 설치를 했다.

npm install react-native-nmap --save -force

그랬더니 android는 build가 되나 ios는 다음과 같은 unknown-unsupported file format build error가 난다.

ld: warning: ignoring file /Users/momo/naverMapTest/ios/Pods/NMapsMap/framework/NMapsMap.framework/NMapsMap, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NMFCameraPosition", referenced from:
      objc-class-ref in libreact-native-nmap.a(RCTConvert+NMFMapView.o)
  "_OBJC_METACLASS_$_NMFNaverMapView", referenced from:
      _OBJC_METACLASS_$_RNNaverMapView in libreact-native-nmap.a(RNNaverMapView.o)
  "_OBJC_CLASS_$_NMFCircleOverlay", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapCircleOverlay.o)
  "_OBJC_CLASS_$_NMFNaverMapView", referenced from:
      _OBJC_CLASS_$_RNNaverMapView in libreact-native-nmap.a(RNNaverMapView.o)
  "_OBJC_CLASS_$_NMGPolygon", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPolygonOverlay.o)
  "_OBJC_CLASS_$_NMGLatLngBounds", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapViewManager.o)
      objc-class-ref in libreact-native-nmap.a(RCTConvert+NMFMapView.o)
  "_OBJC_CLASS_$_NMFCameraUpdate", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapViewManager.o)
      objc-class-ref in libreact-native-nmap.a(RCTConvert+NMFMapView.o)
  "_OBJC_CLASS_$_NMGLatLng", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapCircleOverlay.o)
      objc-class-ref in libreact-native-nmap.a(RCTConvert+NMFMapView.o)
  "_OBJC_CLASS_$_NMFOverlayImage", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapMarker.o)
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPathOverlay.o)
  "_OBJC_CLASS_$_NMFPath", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPathOverlay.o)
  "_OBJC_CLASS_$_NMFPolylineOverlay", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPolylineOverlay.o)
  "_OBJC_CLASS_$_NMFMarker", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapMarker.o)
  "_OBJC_CLASS_$_NMGLineString", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPathOverlay.o)
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPolylineOverlay.o)
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPolygonOverlayManager.o)
  "_OBJC_CLASS_$_NMFAlignType", referenced from:
      objc-class-ref in libreact-native-nmap.a(RCTConvert+NMFMapView.o)
  "_OBJC_CLASS_$_NMFPolygonOverlay", referenced from:
      objc-class-ref in libreact-native-nmap.a(RNNaverMapPolygonOverlay.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'YogaKit' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the naverMapTest editor. (in target 'naverMapTest' from project 'naverMapTest')

** BUILD FAILED **


The following build commands failed:
        Ld /Users/momo/Library/Developer/Xcode/DerivedData/naverMapTest-bocvwscvfhxhtnejtkhbjbvdyeeu/Build/Products/Debug-iphonesimulator/naverMapTest.app/naverMapTest normal
(1 failure)

info Run CLI with --verbose flag for more details.

2. solution

http://susemi99.kr/6178/에서 설명하는 것처럼 Pods파일에서 'NMapsMap'의 버전을 'NMapsMap','3.10.1'와 같이 명시해준다. 현재 버전 'NMapsMap','3.10.2'에서 한단계 내린 것이다.

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'naverMapTest' do
  config = use_native_modules!
  pod 'NMapsMap','3.10.1'
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'naverMapTestTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end

그런 후 다음과 같이 git-lfs install로 git-lfs초기화 후 Pods, Podfile.lock을 지우고 pod install --repo-update을 해주었다.

momo@momoui-Macmini ios % git-lfs install
Updated git hooks.
Git LFS initialized.
momo@momoui-Macmini ios % rm -rf Pods        
momo@momoui-Macmini ios % rm -rf Podfile.lock
momo@momoui-Macmini ios % pod install --repo-update
Auto-linking React Native module for target `naverMapTest`: react-native-nmap
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.64.0)
Installing FBReactNativeSpec (0.64.0)
Installing Flipper (0.75.1)
Installing Flipper-DoubleConversion (1.1.7)
Installing Flipper-Folly (2.5.1)
Installing Flipper-Glog (0.3.6)
Installing Flipper-PeerTalk (0.0.4)
Installing Flipper-RSocket (1.3.1)
Installing FlipperKit (0.75.1)
Installing NMapsMap (3.10.1)
Installing OpenSSL-Universal (1.1.180)
Installing RCT-Folly (2020.01.13.00)
Installing RCTRequired (0.64.0)
Installing RCTTypeSafety (0.64.0)
Installing React (0.64.0)
Installing React-Core (0.64.0)
Installing React-CoreModules (0.64.0)
Installing React-RCTActionSheet (0.64.0)
Installing React-RCTAnimation (0.64.0)
Installing React-RCTBlob (0.64.0)
Installing React-RCTImage (0.64.0)
Installing React-RCTLinking (0.64.0)
Installing React-RCTNetwork (0.64.0)
Installing React-RCTSettings (0.64.0)
Installing React-RCTText (0.64.0)
Installing React-RCTVibration (0.64.0)
Installing React-callinvoker (0.64.0)
Installing React-cxxreact (0.64.0)
Installing React-jsi (0.64.0)
Installing React-jsiexecutor (0.64.0)
Installing React-jsinspector (0.64.0)
Installing React-perflogger (0.64.0)
Installing React-runtimeexecutor (0.64.0)
Installing ReactCommon (0.64.0)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.5)
Installing libevent (2.1.12)
Installing react-native-nmap (0.0.59)
Generating Pods project
Integrating client project
Pod installation complete! There are 51 dependencies from the Podfile and 42 total pods installed.

[!] FBReactNativeSpec has added 1 script phase. Please inspect before executing a build. See `https://guides.cocoapods.org/syntax/podspec.html#script_phases` for more information.

build success

드디어 build 성공~~~

profile
바꿀 수 있는 것에 주목하자

0개의 댓글