[英]How to fix error React Native 'UMCore' build error in Xcode
I'm ejecting my Expo app to Expo Kit. 我将我的Expo应用弹出到Expo Kit。 I did so by running
expo eject
, which generated the ios and android files. 我这样做是通过运行
expo eject
生成的,生成了ios和android文件。
When I follow this guide to run my project, I run expo start
and expo will run the app on the client. 当我按照本指南运行项目时,我将运行
expo start
,expo将在客户端上运行该应用程序。 However, when I try to follow step 3 , I run into a problem. 但是,当我尝试执行步骤3时 ,遇到了问题。
I will go into my ios directory and run pod install
like so: 我将进入ios目录并像这样运行
pod install
:
cd ./ios
pod install
After this, I open up Xcode and hit the 'Run' button. 之后,我打开Xcode并点击“运行”按钮。
After some seconds, the build fails with 3 errors. 几秒钟后,构建失败,出现3个错误。 Here's what that looks like:
看起来像这样:
As you can see, all of these errors seem to be coming from a development Pod called 'UMCore'. 如您所见,所有这些错误似乎都来自名为“ UMCore”的开发Pod。
I've tried deleting all pods and reinstalling them with pod install
, as well as updating cocoapods and running again, but the issue persists. 我尝试删除所有Pod并使用
pod install
重新安装它们,以及更新cocoapods并再次运行,但是问题仍然存在。
This is what my Podfile looks like 这就是我的Podfile的样子
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'gearcaster-mobile' do
pod 'ExpoKit',
:git => "http://github.com/expo/expo.git",
:tag => "ios/2.11.2",
:subspecs => [
"Core"
],
:inhibit_warnings => true
# Install unimodules
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
use_unimodules!(
modules_paths: ['../node_modules'],
exclude: [
'expo-face-detector',
'expo-payments-stripe',
],
)
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"CxxBridge"
]
pod 'yoga',
:path => "../node_modules/react-native/ReactCommon/yoga",
:inhibit_warnings => true
pod 'DoubleConversion',
:podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
:inhibit_warnings => true
pod 'Folly',
:podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
:inhibit_warnings => true
pod 'glog',
:podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
:inhibit_warnings => true
post_install do |installer|
installer.pods_project.main_group.tab_width = '2';
installer.pods_project.main_group.indent_width = '2';
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
if pod_name == 'ExpoKit'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
# Enable Google Maps support
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS_UTILS=1'
end
end
if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? pod_name
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
# Can't specify this in the React podspec because we need to use those podspecs for detached
# projects which don't reference ExponentCPP.
if pod_name.start_with?('React')
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
end
end
# Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
# RCT_ENABLE_PACKAGER_CONNECTION disabled
next unless pod_name == 'React'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ENABLE_PACKAGER_CONNECTION=0'
end
end
end
end
Cocoapods 1.7.5 椰子足1.7.5
Expo-CLI 3.0.6 世博会CLI 3.0.6
React-Native: 0.59.8 React-Native:0.59.8
将Xcode更新到版本10解决了此问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.