参照
cordova-ios
在Mac上执行ionic cordova build ios
失败
错误信息
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/joyoduan/Downloads/Driveprince/Hybrid-App/drive-coach/drive-coach/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/joyoduan/Downloads/Driveprince/Hybrid-App/drive-coach/drive-coach/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/joyoduan/Downloads/Driveprince/Hybrid-App/drive-coach/drive-coach/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
解决办法
- 在打包命令后添加:
-- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
- 修改
build.json
配置文件,在iOS版本或调试配置下添加以下内容:
"buildFlag": [
"-UseModernBuildSystem=0"
]