Ionic v1 build iOS failed "Main.ts"

Hello,

I’m quite new with ionic and I have a problem with my current ionic v1 app.

The application, so far, works without any issue using the ios and android browser emulators.

I got the project’s sources on the mac, went into the app folder.
Following the documentation (Publishing Your Android or iOS App in Google Play & App Store - Ionic Framework),
And after installing the ios platform through :

ionic cordova platform add ios

I tried to run this command within the mac’s terminal :

ionic cordova build ios

and got the following error :

MacBook-Air:MobileApp dev$ ionic cordova build ios
Running app-scripts build: --platform ios --target cordova
[15:31:03]  build dev started ... 
Error: /{PATH}/MobileApp/src/app/main.ts was not found. The "main.dev.ts" and "main.prod.ts" files have been deprecated. Please create a new file "main.ts" containing the content of "main.dev.ts", and then delete the deprecated files.
                            For more information, please see the default Ionic project main.ts file here:
                            https://github.com/ionic-team/ionic2-app-base/tree/master/src/app/main.ts
    at new BuildError (/{PATH}/MobileApp/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /{PATH}/MobileApp/node_modules/@ionic/app-scripts/dist/build/util.js:92:21
    at <anonymous>

The versions i’m currently using are :

ionic cli => 3.19.1
cordova => 8.0.0
npm => 5.6.0
node => 8.9.4

I’m wondering why would the build require a --main.ts-- file (which started being used in ionic v2 if i’m not mistaken) to build the v1 app ??

Have I misread the doc or am I missing something ?

1 Like