在更大的范围内,我求助于创建一个空白项目并运行我的构建命令。 同样的错误:
ionic start myApp blank
cd myApp
ionic cordova run ios --debug --target="iPhone-8" --consolelogs
ionic-app-scripts build --target cordova --platform ios
[11:39:29] ionic-app-scripts 3.2.0
[11:39:29] build dev started ...
[11:39:30] clean started ...
[11:39:30] clean finished in 1 ms
[11:39:30] copy started ...
[11:39:30] deeplinks started ...
[11:39:30] deeplinks finished in 15 ms
[11:39:30] transpile started ...
[11:39:33] transpile finished in 3.16 s
[11:39:33] preprocess started ...
[11:39:33] preprocess finished in 1 ms
[11:39:33] webpack started ...
[11:39:33] copy finished in 3.31 s
[11:39:37] webpack finished in 4.35 s
[11:39:37] sass started ...
[11:39:38] sass finished in 1.27 s
[11:39:38] postprocess started ...
[11:39:38] postprocess finished in 10 ms
[11:39:38] lint started ...
[11:39:38] build dev finished in 8.92 s
[11:39:41] lint finished in 2.65 s
> cordova run ios --debug --target iPhone-8
Building for iPhone 8 Simulator
Building project: /myApp/platforms/ios/myApp.xcworkspace
Configuration: Debug
Platform: emulator
Build settings from command line:
CONFIGURATION_BUILD_DIR =
/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator12.0
SHARED_PRECOMPS_DIR =
/myApp/platforms/ios/build/sharedpch
Build settings from configuration file '
/myApp/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
/myApp/platforms/ios/build/emulator/myApp.app/Info.plist file not found.
[ERROR] An error occurred while running subprocess cordova.
cordova run ios --debug --target iPhone-8 exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
ionic --version
4.1.2
cordova --version
8.0.0 & @latest 8.1.1
XCode Version 10.0 (10A255) + build tools
macOS 10.13.6 - High Sierra. Mojave on a different machine fails the same.
如果有人想知道的话,将调整路径。
--------------修复--------------
与@DaveAlden的答案一起,这就是我如何备份它以进行livereload而没有错误:
ionic cordova platform remove ios
sudo npm install -g ionic@3.20.0
ionic cordova platform add ios
open platform/ios/MyApp.xcworkspace
按照说明回退到旧版构建系统 https://github.com/apache/cordova-ios/issues/407
运行我的构建脚本,不使用--buildFlag='-UseModernBuildSystem=0'
答案 0 :(得分:34)
此问题是由于Xcode 10包含当前与this meta_post
-see here不兼容的新构建系统引起的。
目前的解决方案是使用cordova-ios@4
选项运行Cordova,以指示Xcode使用旧的构建系统,例如:
--buildFlag='-UseModernBuildSystem=0'
更新:为了方便起见,我将其包装在shell脚本中:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
我将其保存在名为#!/bin/bash
# Adds build flag to make cordova-ios@4 work with Xcode 10
cordova "$@" --buildFlag='-UseModernBuildSystem=0'
的文件中,确保它在路径中并使其可执行(cordova-xcode10
),然后我可以这样做:
chmod a+x cordova-xcode10
它将与Xcode 10一起使用
答案 1 :(得分:5)
此问题是由于Xcode 10引起的。 我通过两种方法解决了这个问题。
离子cordova build ios---buildFlag =“-UseModernBuildSystem = 0”
在项目的根目录下创建一个build.json文件。
在build.json中,编写以下代码。
<dl class="row">
<dt class="col-sm-3">Address 1:</dt><dd class="col-sm-9">{{ client.address1|default_if_none:" " }}</dd>
<dt class="col-sm-3">Address 2:</dt><dd class="col-sm-9">{{ client.address2|default_if_none:" " }}</dd>
<dt class="col-sm-3">Town:</dt><dd class="col-sm-9">{{ client.town|default_if_none:" " }}</dd>
<dt class="col-sm-3">County:</dt><dd class="col-sm-9">{{ client.county|default_if_none:" " }}</dd>
<dt class="col-sm-3">Postcode:</dt><dd class="col-sm-9">{{ client.postcode|default_if_none:" " }}</dd>
<dt class="col-sm-3">Telephone1:</dt><dd class="col-sm-9">{{ client.telephone1|default_if_none:" " }}</dd>
<dt class="col-sm-3">Telephone2:</dt><dd class="col-sm-9">{{ client.telephone2|default_if_none:" " }}</dd>
<dt class="col-sm-3">Email:</dt><dd class="col-sm-9">{{ client.email|default_if_none:" " }}</dd>
</dl>
之后,您可以运行这些命令而不会出现任何错误。
{
"ios": {
"debug": {
"buildFlag": ["-UseModernBuildSystem=0"]
},
"release": {
"buildFlag": ["-UseModernBuildSystem=0"]
}
}
}
ionic cordova build ios
ionic cordova run ios
答案 2 :(得分:1)
这对我有用
zones = [i.strip(" \"\'").encode("ascii", "ignore")
更新
我刚刚发现Cordova IOS 5.0.0已发布。 https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html
答案 3 :(得分:0)
这对我有用:
cd platforms/ios/cordova && npm install ios-sim@latest
答案 4 :(得分:0)
这对我有用:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
答案 5 :(得分:0)
仅在命令中添加此标志
cordova run ios --device --buildFlag='-UseModernBuildSystem=0' --verbose
对我来说很好