Ionic Cordova Build --Prod flag not working in iOS Xcode 10


#1

While executing ionic cordova build command with --prod flag gives compiler erros in iOS xCode 10 environment, When I raised this in [cordova-ios] group https://github.com/apache/cordova-ios/issues/446 they said it is ionic specific issue, hence I am posting here. Please suggest.


ionic cordova build ios --release --prod – --buildFlag="-UseModernBuildSystem=0"

Below compiler error I am getting while executing above command in MAC with xCode 10

74-80-250-211:ios user913708$ [ERROR] An error occurred while running subprocess ionic-app-scripts.

-bash: [ERROR]: command not found

74-80-250-211:ios user913708$

74-80-250-211:ios user913708$ ionic-app-scripts build --prod --target cordova --platform ios exited

    with exit code 1.

    

    Re-running this command with the --verbose flag may provide more 

    information.[12:36:57]  ionic-app-scripts 3.2.0 

[12:36:57] build prod started …

[12:36:57] ionic-app-script task: “build”

[12:36:57] Error: tsconfig: Cannot read file ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’:

        ENOENT: no such file or directory, open 

        '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json'. 

Error: tsconfig: Cannot read file ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’: ENOENT: no such file or directory, open ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’.

at new BuildError (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)

at getTsConfig (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:313:15)

at Object.<anonymous> (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:298:46)

at step (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:32:23)

at Object.next (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:13:53)

at /Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:7:71

at new Promise (<anonymous>)

at __awaiter (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:3:12)

at Object.getTsConfigAsync (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:295:12)

at Object.validateRequiredFilesExist (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/build/util.js:89:21)

74-80-250-211:ios user913708$ with exit code 1


**Below is package.json in my project**

 {
  "name": "xxxxxx",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },

  "dependencies": {
    "@angular/animations": "5.2.10",
    "@angular/cdk": "^6.4.7",
    "@angular/common": "5.2.10",
    "@angular/compiler": "5.2.10",
    "@angular/compiler-cli": "^6.1.10",
    "@angular/core": "5.2.10",
    "@angular/forms": "5.2.10",
    "@angular/http": "5.2.10",
    "@angular/material": "^6.4.7",
    "@angular/platform-browser": "5.2.10",
    "@angular/platform-browser-dynamic": "5.2.10",
    "@ionic-native/app-rate": "^4.16.0",
    "@ionic-native/background-mode": "^4.16.0",
    "@ionic-native/core": "^4.16.0",
    "@ionic-native/device": "^4.16.0",
    "@ionic-native/geolocation": "^4.16.0",
    "@ionic-native/in-app-purchase-2": "^4.16.0",
    "@ionic-native/local-notifications": "^4.16.0",
    "@ionic-native/push": "^4.16.0",
    "@ionic-native/splash-screen": "4.6.0",
    "@ionic-native/status-bar": "4.6.0",
    "@ionic/storage": "2.1.3",
    "@ngx-translate/core": "^9.1.1",
    "@ngx-translate/http-loader": "^2.0.1",
    "angular-moment": "^1.3.0",
    "cc.fovea.cordova.purchase": "^7.2.4",
    "cordova-android": "^6.4.0",
    "cordova-ios": "4.5.5",
    "cordova-plugin-apprate": "^1.4.0",
    "cordova-plugin-background-mode": "^0.7.2",
    "cordova-plugin-badge": "^0.8.7",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-dialogs": "^2.0.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-globalization": "^1.11.0",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-local-notification": "^0.9.0-beta.2",
    "cordova-plugin-nativestorage": "^2.3.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.5.0",
    "cryptiles": "^4.1.2",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "moment": "^2.22.2",
    "rxjs": "^6.3.3",
    "rxjs-compat": "^6.3.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },

  "devDependencies": {
    "@ionic/app-scripts": "^3.2.0",
    "@ionic/lab": "1.0.9",
    "typescript": "~2.6.2"
  },

  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cc.fovea.cordova.purchase": {},
      "cordova-plugin-background-mode": {},
      "cordova-plugin-apprate": {},
      "cordova-plugin-badge": {},
      "cordova-plugin-device": {},
      "cordova-plugin-dialogs": {},
      "cordova-plugin-geolocation": {},
      "cordova-plugin-globalization": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-local-notification": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-whitelist": {},
      "cordova-sqlite-storage": {}
    },

    "platforms": [
      "android",
      "ios"
    ]
  }
}--

Below is the ionic info

Ionic:
   ionic (Ionic CLI)  : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:
   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, (and 12 other plugins)

System:
   ios-sim : 7.0.0
   NodeJS  : v8.11.3 (/usr/local/bin/node)
   npm     : 5.6.0
   OS      : macOS
   Xcode   : Xcode 10.0 Build version 10A255

Please help. Also posted in stackoverflow


#2

Guys, if I can’t come out of this mess have to start writing the Objective-C having a seamless experience with Androids till now like to continue, please help :slight_smile:


#3

Are you able to build for Android?

Can you reproduce the problem and share the repo? Happy to try locally.


#4

There is absolutely no such build issues with the Android. Below compiler error I am getting while executing the ionic cordova build ios --release --prod – --buildFlag="-UseModernBuildSystem=0"

syntax error near unexpected token `newline'

74-80-250-211:ios user913708$ [ERROR] An error occurred while running subprocess ionic-app-scripts.

-bash: [ERROR]: command not found

74-80-250-211:ios user913708$         

74-80-250-211:ios user913708$         ionic-app-scripts build --prod --target cordova --platform ios exited 

        with exit code 1.

        

        Re-running this command with the --verbose flag may provide more 

        information.[12:36:57]  ionic-app-scripts 3.2.0 

[12:36:57]  build prod started ... 

[12:36:57]  ionic-app-script task: "build" 

[12:36:57]  Error: tsconfig: Cannot read file '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json': 

            ENOENT: no such file or directory, open 

            '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json'. 

Error: tsconfig: Cannot read file '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json': ENOENT: no such file or directory, open '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json'.

    at new BuildError (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)

    at getTsConfig (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:313:15)

    at Object.<anonymous> (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:298:46)

    at step (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:32:23)

    at Object.next (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:13:53)

    at /Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:7:71

    at new Promise (<anonymous>)

    at __awaiter (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:3:12)

    at Object.getTsConfigAsync (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:295:12)

    at Object.validateRequiredFilesExist (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/build/util.js:89:21)

74-80-250-211:ios user913708$         with exit code 1

.–


#5

And the second part of my query???


#6

please find repo at https://github.com/nagthgr8/vedichoroo