ios - 空白应用程序无法调试构建 -/找不到 Info.plist 文件

标签 ios cordova ionic-framework ionic2 ionic3

在更大的上下文中,我求助于创建一个空白项目并运行我的构建命令。 同样的错误:

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 平台删除 ios sudo npm install -g ionic@3.20.0 ionic cordova 平台添加 ios 打开平台/ios/MyApp.xcworkspace

按照说明回退到遗留构建系统 https://github.com/apache/cordova-ios/issues/407

运行我的构建脚本,不带 --buildFlag='-UseModernBuildSystem=0'

最佳答案

这个问题是因为 Xcode 10 包含一个新的构建系统,目前与 cordova-ios@4 不兼容 - see here .

目前的解决方案是使用 --buildFlag='-UseModernBuildSystem=0' 选项运行 Cordova 以指示 Xcode 使用旧的构建系统,例如:

 cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'

更新:为了方便起见,我将其包装在一个 shell 脚本中:

#!/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),然后我可以这样做:

cordova-xcode10 run ios --target "iPhone-8"

它将与 Xcode 10 一起工作

关于ios - 空白应用程序无法调试构建 -/找不到 Info.plist 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52584550/

相关文章:

iphone - 适用于 iOS 和 MacOS X 的应用程序

ios - 关闭所有非当前 View

ios - 当我在 watch 套件扩展或 iPhone 蓝牙中使用 corebluetooth 框架时,Apple Watch 是否使用自己的蓝牙?

iphone - 更改界面方向时在 UIScrollView 上出现奇怪的跳转 (ATPagingView)

angular - 在 Ionic 中编写 JSON 文件

android - Ionic Android 内部共享内存

angularjs - Cordova /Phonegap - 横向 View

ionic-framework - Ionic has-header 在列表中被忽略

javascript - Cordova 中按距离排序数组

cordova - typescript 错误 : Cannot find name 'cordova'