React Native에서 XcodeBuild에서 duplicate 오류를 해결하는 방법
4340 단어 Xcodereactnative
개요
평소에는 React Native에서 iOS 앱을 개발하고 있습니다.
이번에는, react-native-google-maps 등의 도입에 의해, React나 Yoga등을 pod install했을 때 Xcode로 build 하면 duplicate 에러가 나오는 문제를 해결하는 메모를 공유합니다
platform :ios, '9.0'
target 'Your App Name' do
pod 'Yoga', :path => '../node_modules/react- native/ReactCommon/yoga'
pod "React", :path => '../node_modules/react-native', :subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"BatchedBridge"
]
pod 'GoogleMaps'
pod 'react-native-maps', path: '../node_modules/react-native-maps'
pod 'react-native-google-maps', path: '../node_modules/react-native-maps'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "react-native-google-maps"
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
end
end
위와 같은 podfile로 pod install을하면 아래와 같은 오류가 발생합니다.
ld: warning: directory not found for option '-L/Directory/Your/App/name'
duplicate symbol _OBJC_CLASS_$_RCTVibration in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_METACLASS_$_RCTVibration in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_CLASS_$_RCTFrameAnimation in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTFrameAnimation.o)
~~~中略~~~
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_CLASS_$_PodsDummy_Yoga in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
duplicate symbol _OBJC_METACLASS_$_PodsDummy_Yoga in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
ld: 421 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
해결
pod install시에 React와 Yoga가 pod로 인스톨되어 버리고 있으므로, workspace에서 열어 pod 프로젝트를 선택한다
React와 Yoga가 있기 때문에
아래 이미지처럼 React와 Yoga를 Target에서 제거
이제 duplicate가 나오지 않으므로 build가 정상적으로 할 수 있습니다.
Reference
이 문제에 관하여(React Native에서 XcodeBuild에서 duplicate 오류를 해결하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/VerfolgungEin/items/f3ef291e0335eb4a2337
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
platform :ios, '9.0'
target 'Your App Name' do
pod 'Yoga', :path => '../node_modules/react- native/ReactCommon/yoga'
pod "React", :path => '../node_modules/react-native', :subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"BatchedBridge"
]
pod 'GoogleMaps'
pod 'react-native-maps', path: '../node_modules/react-native-maps'
pod 'react-native-google-maps', path: '../node_modules/react-native-maps'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "react-native-google-maps"
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
end
end
ld: warning: directory not found for option '-L/Directory/Your/App/name'
duplicate symbol _OBJC_CLASS_$_RCTVibration in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_METACLASS_$_RCTVibration in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_CLASS_$_RCTFrameAnimation in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTFrameAnimation.o)
~~~中略~~~
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_CLASS_$_PodsDummy_Yoga in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
duplicate symbol _OBJC_METACLASS_$_PodsDummy_Yoga in:
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
/Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
ld: 421 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
pod install시에 React와 Yoga가 pod로 인스톨되어 버리고 있으므로, workspace에서 열어 pod 프로젝트를 선택한다
React와 Yoga가 있기 때문에
아래 이미지처럼 React와 Yoga를 Target에서 제거
이제 duplicate가 나오지 않으므로 build가 정상적으로 할 수 있습니다.
Reference
이 문제에 관하여(React Native에서 XcodeBuild에서 duplicate 오류를 해결하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/VerfolgungEin/items/f3ef291e0335eb4a2337텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)