12

In a larger context I resorted back to creating a blank project and running my build commands. Same error:

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.

The paths are adjusted if anyone wonders...

-------------- FIX --------------

Together with @DaveAlden's answer this is how I got it back up to do livereload without the bugs:

ionic cordova platform remove ios sudo npm install -g ionic@3.20.0 ionic cordova platform add ios open platform/ios/MyApp.xcworkspace

Follow instructions to fall back to legacy build system as on https://github.com/apache/cordova-ios/issues/407

Run my build script, without the --buildFlag='-UseModernBuildSystem=0'

El Dude
  • 5,328
  • 11
  • 54
  • 101

6 Answers6

38

This problem is caused because Xcode 10 contains a new build system which is currently not compatible with cordova-ios@4 - see here.

The solution for now is to run Cordova with the --buildFlag='-UseModernBuildSystem=0' option to instruct Xcode to use the old build system, e.g.:

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

Update: For my own convenience, I've wrapped this in a shell script:

#!/bin/bash
# Adds build flag to make cordova-ios@4 work with Xcode 10
cordova "$@" --buildFlag='-UseModernBuildSystem=0'

I saved this in a file called cordova-xcode10, made sure it's in the path and made it executable (chmod a+x cordova-xcode10), then I can just do:

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

and it will work with Xcode 10

DaveAlden
  • 30,083
  • 11
  • 93
  • 155
  • 2
    Thanks. Yes, I confirm. Just found that 1h ago. However, now my livereload / consolelog is disabled or does not work, even after setting to legacy in xcode. – El Dude Oct 02 '18 at 05:40
  • See my comment above how to re-enable live reload. The `buildFlag` seems to override this... – El Dude Oct 02 '18 at 16:08
7

This problem is caused because of Xcode 10. I resolved this issue by two ways.

  1. ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

  2. Create a build.json file on root of project.

In build.json write below code.

{
    "ios": {
        "debug": {
            "buildFlag": ["-UseModernBuildSystem=0"]
        },
        "release": {
            "buildFlag": ["-UseModernBuildSystem=0"]
        }
    }
}

After that you can run these commands without any error.

  • ionic cordova build ios
  • ionic cordova run ios
  • ionic cordova run ios --target="iPhone-6s" -l
Derk Jan Speelman
  • 11,291
  • 4
  • 29
  • 45
Manish
  • 13,047
  • 1
  • 12
  • 9
  • 1
    Upvoting this answer in preference to the accepted answer, as it explains how to add the flag to your build config so that it doesn't need to be added via the command-line on each invocation. Much better than requiring each developer to set up a wrapper script as suggested in the accepted answer. – HappyDog Mar 08 '19 at 14:05
1

This worked for me

Open your workspace file, then File --> WorkSpace Settings

In shared Workspace settings, choose Build System: Legacy Build System.

Then run ionic cordova run -l

Source(last comment): https://forum.ionicframework.com/t/fresh-ionic-fails-to-emulate-ios-12-info-plist-file-not-found/142291

Update

I just found out that Cordova IOS 5.0.0 was released. https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html

Ciprian
  • 3,066
  • 9
  • 62
  • 98
1

This worked for me:

cd platforms/ios/cordova && npm install ios-sim@latest
Brickyenne
  • 21
  • 4
0

This works for me:

cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
uyghurbeg
  • 176
  • 3
  • 8
0

only add this flag in you command

cordova run ios --device --buildFlag='-UseModernBuildSystem=0' --verbose

work fine for me