[ANNOUNCEMENT] Status of Xcode 10 support
dpogue opened this issue Β· 158 comments
A few issues have started to come in regarding the state of Cordova projects on Xcode 10. This is a rough summary of the situation:
Xcode 10 uses a new build system by default (previously available on an opt-in basis in Xcode 9). The cordova-ios project structure is not compatible with this new build system and results in failures.
Officially, we do not claim to support Xcode 10.
Currently the best workaround is to opt-out of the new build system:
-
If you're building on the command-line, you can specify
--buildFlag="-UseModernBuildSystem=0"
:# Cordova CLI cordova run ios --buildFlag='-UseModernBuildSystem=0' cordova build ios --buildFlag='-UseModernBuildSystem=0' # Ionic CLI ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0" ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
-
If you're building with a build.json config file, you can add the following under the iOS release or debug config:
"buildFlag": [ "-UseModernBuildSystem=0" ]
-
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
We're going to investigate what's required to make cordova-ios compatible with the new build system, and hope to include that in the next major version (cordova-ios@5.0.0).
Just note here that the build.json file should look like this :
"ios": {
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
not
"iOS": {
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
like "mentioned" in the previous comment ;p
Thanks, @dpogue
I was really wondering about the workaround. Hope to fix it soon!
Cheers
is this why im getting this issue
ERROR ITMS-90174: "Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision."
is there a workaround ?
@neofuture I am also encountering this after upgrading to XCode 10
Then open an issue please that has all available information on these failures @neofuture and @aceoliver. Thanks.
Is this ALL you guys needed to do? Nobody kept getting these errors?
[09:22:43]: [Transporter Error Output]: ERROR ITMS-90087: "Unsupported Architectures. The executable for TheApp.app/Frameworks/Sentry.framework contains unsupported architectures '[x86_64, i386]'."
[09:22:43]: [Transporter Error Output]: ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'TheApp.app/Frameworks/Sentry.framework/Sentry' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
[09:22:43]: [Transporter Error Output]: ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
Edit: Sorry, I just realized these are Sentry's issues.
@sambegin Thanks for the workaround. Where is this build.json file is present in the app directory structure?
Btw this worked for me:
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
@jeffreyramia with the help of your answer I am able to build an app but whenever I am trying to emulate it gives me an error as "platforms/ios/build/emulator/demo APP.app/Info.plist file not found.
[ERROR] An error occurred while running subprocess cordova."
If you use pure cordova ios, you can run like:
cordova run --target='iPad-Air-2' --buildFlag='-UseModernBuildSystem=0'
@PeterStegnar I won't be run because info.plist not present in the /build directory.
@PeterStegnar I won't be run because info.plist not present in the /build directory.
Yes this happen if you are using new build system. If you say to compiler to build legacy build then it is OK. All you need to do it so use:
--buildFlag='-UseModernBuildSystem=0'
Just do document what I'm seeing
Build with no command seems to just stop in the middle of it. It seems like its trying to build for some large of phonesxs default.
Build with the new command
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Seems to build just fine and was able to push a version to the phone.
For ionic I see a build.json file. I add the following to it.
{
"ios": {
"debug": {
"developmentTeam": "898989",
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
"release": {
"developmentTeam": "89989898",
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
}
It seems to look at the build.json, either I don't have it setup right or something because its not using the command.
Code Signing Error: Automatic signing is unable to resolve an issue with the "APP NAME" target's entitlements. Automatic signing can't add the aps-environment entitlement to your provisioning profile. Switch to manual signing and resolve the issue by downloading a matching provisioning profile from the developer website. Alternatively, to continue using automatic signing, remove this entitlement from your entitlements file and its associated functionality from your code.
Code Signing Error: Provisioning profile "iOS Team Provisioning Profile: com.app.dev.app" doesn't include the aps-environment entitlement.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 12.0'
I don't think that error surprise us. But not sure why adding the command to build.json file doesn't seem to work.
I don't think that error surprise us. But not sure why adding the command to build.json file doesn't seem to work.
That error about code signing is unrelated to the new build system.
In your build.json you are not including the flags to use automatic provisioning, but you are also not specifying which provisioning profile to use. This probably wouldn't work in Xcode 9 either.
Okay, so I don't have the build.json file really setup to be used. Other values would need to be in there. For now just have to use the command line.
Is there any plan to support the modern build system?
Is there any plan to support the modern build system?
Yes, in the next major version, which we're currently working on. But we don't have a timeline for release beyond something before the end of the year.
@PeterStegnar Thanks I am able to build and emulate app on ios with the help of --buildFlag='-UseModernBuildSystem=0' this flag. Does anyone have documentation link for this flag?
I have to explore it more.
Is anyone having trouble using the --livereload
flag with --buildFlag='-UseModernBuildSystem=0'
? If so any ideas how to enable livereload
--livereload
is not part of Cordova. You will probably want to ask this question over at http://forum.ionicframework.com/ or one of their repositories, possibly Ionic CLI.
@andrewmcewen Yes: I get a lot of starting
messages without the build actually starting.
Created this ionic forum question: https://forum.ionicframework.com/t/exception-with-livereload-when-using-flag-usemodernbuildsystem/142728
when:ionic cordova run ios --emulator --buildFlag="-UseModernBuildSystem=0"
** BUILD SUCCEEDED **
No target specified for emulator. Deploying to iPhone-XS-Max, 12.0 simulator
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
logPath: /Users/Mango/desktop/app4/platforms/ios/cordova/console.log[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
but
console.log not exist.
app not deployed.
when:ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
app deployed to iPhone 7 Plus, and work fine
when: use Xcode 10
simulator ok
iPhone 7 Plus ok
@499978920 Your first command is missing an --
. You need two of those before buildflag
so it gets routed to cordova
and not ionic
.
@dpogue I added the "-UseModernBuildSystem=0" flag to my build.json and that does address the problem we were having as mentioned on issue apache/cordova-cli#329 . Should we expect the UserModernBuildSystem=0 setting to also persist into the generated workspace, or is it always necessary to manually make that setting change in the Workspace Settings dialog as you have shown above?
Should we expect the UserModernBuildSystem=0 setting to also persist into the generated workspace, or is it always necessary to manually make that setting change in the Workspace Settings dialog as you have shown above?
If you open the project in Xcode, you must change the Workspace Settings. The command-line flags only affect the command-line builds.
@dpogue Thanks for your comment, you save my time!
@499978920 Your first command is missing an
--
. You need two of those beforebuildflag
so it gets routed tocordova
and notionic
.
ionic cordova build ios --emulator -- --buildFlag="-UseModernBuildSystem=0"
ok
but
ionic cordova run ios --emulator --target="iPhone-XS" -- --buildFlag="-UseModernBuildSystem=0"
app not deployed
but
ionic cordova run ios --emulator --target="iPhone-7, 11.4" -- --buildFlag="-UseModernBuildSystem=0"
app deployed
some simulator ok eg: iPhone-XR
some simulator can't deployed eg: iPhone-XS iPhone-XS-Max
You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.
You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.
simulators it's working fine. now.
I have not changed anything. very strange.
Thanks.
Thanks for the workaround. I manage to build using the recommended build flag. However, I only get a blank white screen after the splash screen disappears. The app was working fine when running on Xcode 9. Was wondering if anyone else is having this issue?
I'm running on ionic.
i'm having a similar issue @v-ken. i was able to build by passing --buildConfig, however, my app just stays stuck on the splash screen. it is possible some other plugins are now breaking, but don't know for sure
@jamesparkes Just to get a bit more info, are you using Cordova or Ionic? There has been a report of icons/splashscreens not working in Xcode 10, but other people have said it's working fine π
hey @dpogue i'm using ionic
I don't think the missing splashscreens are a plugin issue. It's probably related to how/where the assets are getting copied in Xcode.
hhhrrrmmm. the splashscreen itself isn't missing, it opens on the splashscreen and the splashscreen never goes away
You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.
simulators it's working fine. now.
I have not changed anything. very strange.
Thanks.
I saw the same issue, but mine didn't magically fix itself. (still trying)
@jamesparkes I'm using Ionic too. And my app works perfectly with --buildConfig
.
Maybe you can try to remove ios platform and add it again.
ionic cordova platform rm ios
ionic cordova platform add ios
i'm good to go now, the buildConfig also worked for me. my issue was another plugin. sorry for the mishap!
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
worked for me, thanks!
--buildFlag="-UseModernBuildSystem=0"
Worked for me too additionaly i need to change the build system in Workspace Settings to "Legacy Build System"
I am just wondering why I don't have this issue. I am on a "self upgrade" of Cordova versions in MeteorJS. I use cordova-lib@8.1.0 and cordova-ios@4.5.5 and I haven't had any problems from my first xcode build with xCode 10. Actually I came into this page because there is an announcement on Cordova blog not because I had any issues.
I believe Meteor is not using cordova-cli and the project is built by this file:
https://github.com/meteor/meteor/blob/devel/tools/cordova/project.js
when I run ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0"
I have
Unknown option: '--buildFlag'
I'm using ng cli 6.2.3
Any idea?
Thanks
when I run
ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0"
I haveUnknown option: '--buildFlag'
I'm using ng cli 6.2.3
Any idea?
Thanks
-- --buildFlag="-UseModernBuildSystem=0"
when I run
ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0"
I haveUnknown option: '--buildFlag'
I'm using ng cli 6.2.3
Any idea?
Thanks
You need to change the build system in Xcode to legacy build system (see screenshots at pullet point 3 in first post).
thanks
I did it, I can run a build in xcode but I'm curious how I can use command line like others with --buildFlag :)
Changing the configuration in xcode to legacy did not work, setting the flag cordova build ios --buildFlag = '- UseModernBuildSystem = 0' did not work and creating the build.json file with the flags also did not work.
I downgrade the Cordova version to 7 and it works normal.
thank you Quentin Valmori
Hi there,
Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this;
Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System" (Under the File Menu)..
After changing to Legacy Build System i still get this error after running:
ionic cordova run ios
error: module importing failed: ('invalid syntax', ('temp.py', 1, 27, 'import fruitstrap_00008020-000914CA3E78002E\n'))
backtrace unavailable
sorry here are my specs
OS: Mac macOS Mojave
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.1.4, (and 5 other plugins)
System:
Android SDK Tools : 26.1.1 (/Users/ronaldcolombo/Library/Android/sdk)
ios-deploy : 1.9.2
NodeJS : v8.9.1 (/usr/local/bin/node)
npm : 5.7.1
OS : macOS
Xcode : Xcode 10.0 Build version 10A255
Just updated to newest xcode. This worked for me for an ionic -v1 project with the emulator and live reload and console. Hope it helps.
ionic cordova emulate ios -l -c -- --buildFlag="-UseModernBuildSystem=0"
--buildFlag="-UseModernBuildSystem=0" is the same as changing the build system to Legacy Build System.. so i'm already doing that technically.. its after doing that the screen goes black after the splash screen and i get that error.
After applying the mentioned fixes, I'm able to build ios to Xcode but as of now ALL my cordova plugins are failing to be added.
Im using ionic 3.9 and after i build to xcode with
ionic cordova build ios
and run it on my phone, every single one of my plugins fail including things like status bar.
I've done standard ionic recommended steps like removing all plugins and the ios project and adding it again, then when running cordova prepare, the plugin gets added to the android project and the browser project correctly but fail to be added to the ios project, usually because of some ios version error or cocoa pods issue.
For example with cordova-plugin-webview
"apple-ios version check failed ("/Users/jonahelbaz/Desktop/Gizer/GitHub/Repositories/gzr-ionic/platforms/ios/cordova/apple_ios_version")"
Any help would be greatly appreciated. If any other info is needed please ask. @dpogue
when I run
ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0"
I haveUnknown option: '--buildFlag'
I'm using ng cli 6.2.3
Any idea?
Thanks
See this issue: ionic-team/ionic-cli#3602
Try running: npm install -g ionic@latest
And then: ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
@BrettKoenig You're trying to send an argument to ng instead of cordova.
Put a file called build.json on your cordova folder with this content:
{
"ios": {
"debug": {
"buildFlag": ["-UseModernBuildSystem=0"]
}
}
}
and run your command again..
@dpogue Thanks!!! worked for me
I am such a noob! I first tried:
ionic cordova build ios --buildFlag="-UseModernBuildSystem=0"
without success until i realized i a missing an extra -- (dash dash)
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Has anyone tried to publish an App to the App Store with this workaround, I'm concerned Apple will reject this kind of builds. Just want to confirm before I send and update of an App I built with Xcode 9.
@mmzepedab Yes I have. Apple has not rejected the app. Don't worry.
I tried all the solutions above but to no avail. I chmodded the app folder recursively to 777 and am building the project within XCode at the moment. But it's rather slow to manage running/building like this.
After changing to Legacy Build System i still get this error after running:
ionic cordova run ios
error: module importing failed: ('invalid syntax', ('temp.py', 1, 27, 'import fruitstrap_00008020-000914CA3E78002E\n'))backtrace unavailable
Hi, @rujinxero . I've got the same error on iPhone XS. I think it's bug with Cordova build system, and they should update platform somehow... Or, do you get any solution for that ?
Adding the legacy flag to my build.json works for the build phase. However, in the distribution phase (I use fastlane for upload to Testflight/appstore), it is not using this variable. Reason being the setting for distribution is taken from Workspace level.
My workaround is now to add a file WorkspaceSettings.xcsettings which holds (in plist format) the key-value BuildSystemType = Original. Will this issue also be cleanly fixed?
I am experiencing the same issue none of above suggestions has fixed. The issue that I am experiencing is the HttpClient calls getting failed as exlained here
my code is something like this....
this.horoService.getPlan(this.device.uuid)
.subscribe(res => {
this.info2 = '';
let pln: Plan = { uuid: res['uuid'], name: res['name'], credits: res['credits'], dobs: res['dobs'] };
this.plan = pln;
if(res['name'] == 'xxx.xxx.xxx.xxx'){
this.showSU = true;
this.showCR = false;
this.showASU = false;
} else if(Number(res['credits']) == 0) {
this.showSU = false;
this.showCR = true;
this.showASU = false;
} else {
this.showSU = true;
this.showCR = false;
this.showASU = true;
}
}, (err) => {
this.showSU = false;
this.showCR = false;
this.showASU = false;
this.info2 = JSON.stringify(err);
});
the error is pointing to main.js line 676 column 15, please note the same code works just fine in Android devices.
infact I just noticed that there is no issue with communication as I could see HTTPResponse coming back correctly while tested from ionic serve whereas (err) in above .subscribe call is showing Unknown URL, Unknown error
Finally the issue is resolved after downgrading to WkWebView to UIWebView and also I missed a xCode build configuration to "Legacy Build System" as explained by @dpogue but however there are some other issues such as tapping not working in some part of SVG for which the event handler attached also like this
this['lstnr_' + id] = this.renderer.listen(svg, 'click', (event) => {
// Do something with 'event'
console.log('clicked ', event.path);
console.log('clicked ', event.path[2]);
this.navCtrl.push(ChartAnalysisPage, {ID: event.path[2].id});
});
this code works fine in Android devices, while I tested this in iPad it failed, not sure if this is due to downgrade or some other problem as I haven't tested any other iOS before and not least first time app loading takes much more time(at least 2-3 mins) than Android devices, can't move this App to production with such wait time. And the App is not well responding to the touch events which is one more annoying thing, not sure if these are all known issues in Cordova or if there is something I miss during iOS build, please suggest!
If I add --prod in command line getting error without which the filesize is big & taking more time while loading the app
- ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
could not find buildFlag option in the ionic cordova link is this outdated? I am having problems with passing --prod flag your suggested way resolves the compiler issue but if I add a prod flag like below throwing compiler error could you please help
ionic cordova build ios --prod -- --buildFlag="-UseModernBuildSystem=0"`
@nagthgr8 you should use:
ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"
@nagthgr8 you should use:
ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"
@gabriellacerda yes I am using the same it fails with below compiler error
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. (/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 ()
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
@nagthgr8 you should use:
ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"
@gabriellacerda yes I am using the same it fails with below compiler error
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. (/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 ()
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
Ok, it seems the compiler is not finding your tsconfig.json
config file, try removing the platform and adding it again:
ionic cordova platform remove ios; ionic cordova platform add ios
Then try building again...
I've noticed that when setting keychain entitlements in Xcode it only copies to the debug.plist and not the release.plist.
Is there a build flag or setting with Cordova CLI where I can force one .plist or create a APP_NAME.entitlements file?
@nagthgr8 you should use:
ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"
@gabriellacerda yes I am using the same it fails with below compiler error
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 exitedwith 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. (/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 ()
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 1Ok, it seems the compiler is not finding your
tsconfig.json
config file, try removing the platform and adding it again:ionic cordova platform remove ios; ionic cordova platform add ios
Then try building again...
@gabriellacerda I followed your instructions while add command is executed I get below response
ionic cordova platform add ios
ENDENT: no such file or directory, uv_cwd
I removed the platform without ionic prefix is that the consequene, how can I fix this now
@nagthgr8 @gabriellacerda Please direct Ionic-related issues to the Ionic discussion forums.
The issues and steps that affect Ionic are similar, but not the same as the ones affecting Cordova, and it's confusing to have Ionic-specific workarounds mentioned in a help issue for Cordova.
Ionic discussion forum seems not so active in responding I already posted there I am clueless right now if this is something I am struggling alone or is a known ionic issue.
got response from Ionic team as below, please somebody from cordova team help, I had to stop production release due to this issue, app is loading very slow(takes about 2 mins), hoping if I could compile with --prod flag this should resolve to some extent.
Unfortunately this issue goes beyond the scope of our own support due to the issue ultimately lying with Cordova 4.X and not Ionic. Hope that provides you with some direction!
Is anyone having trouble using the
--livereload
flag with--buildFlag='-UseModernBuildSystem=0'
? If so any ideas how to enable livereload
You should use ionic cordova run ios --l -- --buildFlag="-UseModernBuildSystem=0"
After changing to Legacy Build System i still get this error after running:
ionic cordova run ios
error: module importing failed: ('invalid syntax', ('temp.py', 1, 27, 'import fruitstrap_00008020-000914CA3E78002E\n'))
backtrace unavailableHi, @rujinxero . I've got the same error on iPhone XS. I think it's bug with Cordova build system, and they should update platform somehow... Or, do you get any solution for that ?
I have exactly same issue to build on my iPhone XS. does someone have any idea?
Hello, yesterday I uploaded my build to the App Store via Xcode.
I used the Legacy Build System and the automatic signature. Everything worked correctly.
My app has been accepted.
@theMartux Hi! to upload your app, did you use this command? ionic cordova run ios --l -- --buildFlag="-UseModernBuildSystem=0" or can you tell me de steps did you follow? because i can't still upload a single app
@ceeespinosa19 ciao.
No. I did not use Ionic. The --buildFlag = "-UseModernBuildSystem = 0" command that you use in Cordova is not required if you use the Xcode build settings. If you setting Legacy Build System in Xcode you can use the default command run in Cordova. In any case, I uploaded my app simply using the Xcode settings on the old build and the automatic signature. Xcode did the rest.
@theMartux
I am fairly new to building Apps (like just started this past two months). Could you further explain the steps you took to build your app in Xcode using the Legacy Build System?
@theMartux
I am fairly new to building Apps (like just started this past two months). Could you further explain the steps you took to build your app in Xcode using the Legacy Build System?
Ciao
Itβs very simple! You should create app with the Cordova CLI command.
Next step you adding the platform iOS and follow the dpogue's steps in her first post.
I ended up getting my app running on my iPhone X.
Steps that I took:
- opened the ionic-ios build folder on Xcode
- attempted build, failed.
- resolved any cautions, literally just had to click and let Xcode do its thing.
- Xcode -> preferences -> accounts: then log in to your developer account and "manage certificates" and add your signing cert.
- then select views -> navigators -> show project navigator
-- should be on a screen that shows info & build settings. on that same like, the first thing should be the name of your app, click that and then select your app in the "targets" area. this will bring up the "general" tab - inside the general tab, change the "bundle identifier" to the name of your developer profile and make sure your team is selected as the signing profile.
- lastly, file -> workspace setting -> change the build setting to legacy.
After these steps the build of my app failed. On my iPhone I had to navigate to Settings -> general - device management -> and trust the signing certificate (I think that is what is was)
Rebuilt the app and everything ran successfully.
Hopefully you all can follow my steps.
Thank you for me using CLI command where I used below command which worked for me well
xcodebuild clean -project /Users/xxx.xcodeproj -configuration Release -alltargets -UseModernBuildSystem = NO
@nagthgr8 Did you find a solution for the problem? I have the same Error...
When i try to upload build to App Store I am getting following error:
Invalid Bundle. The asset catalog at Assets.car' can't be processed. Rebuild your app, and all included extensions and frameworks, with the latest GM version of Xcode and resubmit." I am using Xcode 10.1.
I do have same pb, <..latest GM version of Xcode and resubmit."> . and then I am forced to use the new build system, but unfortunately the notifications didn't work.
It's a known pb, and it's probably linked to how the new build system bundles the provision file inside the app....
if any one succeed making notifs works with the new build, please share...
@steptek Even if you're using the newest version of Xcode, you're not forced to use the new build system. There are instructions in the first post about how to enable the old build system within Xcode.
@dpogue agreed, but you wont be able to push it on apple store for review, same like they are only accepting the new build for v12.1, and I absolutely understand that they are giving backward compatibility either by command line or Xcode menu, but the end is the same, Just we will be enjoying the apps only on device and play with it or say good-bay for notification for Cordova on v12.1.
In fact the embedded.mobileprovision is missing on each build done by new build option, and that's no good for notifications, neither for moving forward and stepping to apple store review (with the legacy option)..
that's not gooooooood.....
@steptek @prasanna-tapzo I built using the old build system and had no problem getting my app approved last night. I suspect something else is causing an issue? I doubt that simply using the legacy build system will stop an app from getting approved?
i use legacy build system ( both xcode config or xcodebuild option ) but app was not work, the build is success but when I run this app, app was crashed. just no error log, how to handle it?
@dpogue Build failed after ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
with message:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
My Ionic info:
Ionic:
ionic (Ionic CLI) : 4.6.0
Ionic Framework : @ionic/angular 4.0.0-beta.19
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.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, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v11.5.0
npm : 6.5.0
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61
Any suggestion?
@dpogue Build failed after
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
with message:dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58.dylib
Referenced from: /usr/local/bin/node
Reason: image not foundMy Ionic info:
Ionic:
ionic (Ionic CLI) : 4.6.0
Ionic Framework : @ionic/angular 4.0.0-beta.19
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.2.0Cordova:
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, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v11.5.0
npm : 6.5.0
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61Any suggestion?
Solved removing node@11.5.0 and icu4c from brew. Then, installed and applied to use node@10.14.2 from nvm and finally reinstalled all node_modules libs, platforms and plugins.
SDK Version Issue - This app was built with the iOS 11.4 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.
Yes, in the next major version, which we're currently working on. But we don't have a timeline for release beyond something before the end of the year.
@dpogue - is there another timeline or target date for 5.0? Would love any info related to that. Thanks!
I'm not sure. I've had pretty much no time to work on anything Cordova-related since that comment, and I likely won't for at least a few months.
There are some folks working on getting updated tools releases out, so they're probably start putting together platform releases after that, but there are still several Xcode 10 issues that have not yet been investigated and fixed.
Just for anyone with a similar problem and want to get it to work with the build.json
At first I tried what's written in the beginning of this thread, but it didn't work:
build.json
"ios": {
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
},
Then I realised I have to add "debug" as well.
Solution:
build.json
"ios": {
"debug": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
},
Just thought I'd leave it here for future reference.
Such a pain to have to add --buildFlag='-UseModernBuildSystem=0' every time, can someone create a pull request to add this flag by default in a minor bump until 5.0.0