cordova-ios: Recieved Error: Command failed with exit code 65
Bug Report
I ran the command cordova build ios
and it returned xcodebuild: Command failed with exit code 65
Problem
The command failed.
What is expected to happen?
It should have built correctly.
What does actually happen?
It doesn’t build and returns an error. See the error in the post I made: https://stackoverflow.com/questions/61847125/ionic-cordova-build-ending-with-xcodebuild-command-failed-with-exit-code-65
Information
I have a full log of what happened here: ERROR
Command or Code
cordova build ios
Environment, Platform, Device
I am running this on Ionic 5 Angular 9. I am on a Macbook Pro Mojave 10.14.6 and Xcode 11.3.1.
Version information
I included that information in the previous section.
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 21 (4 by maintainers)
@marcelmedina
If you’re using Cordova-iOS 6.x, the minimum supported iOS version is 11.0. You may need to remove a
deployment-target
preference from config.xml if it is set to a lower version.Try with previous version of ios library:
cordova platform rm ios cordova platform add ios@5.1.1
FYI, using cordova 6.x and setting the deployment-target to 11.0 also works:
<preference name="deployment-target" value="11.0" />
i could solve this by adding
.0
to the version (11
)Correct.
You can stay on
cordova-ios@5.1.1
. You’d need to install a wkwebview plugin and add<preference name="WKWebViewOnly" value="true" />
flag to yourconfig.xml
to make the app compliant with theUIWebView
deprecation. More details can be found on Cordova’s Blog.The primarily reason why
cordova-ios@6
requires min iOS 11.0 is because it uses the WKWebView url scheme feature to solve many CORS-related issues that occurs on WKWebView when using thefile://
protocol. This feature only exists in iOS 11+. You may also see these issues oncordova-ios@5.1.1
, particularly if you useXMLHttpRequest
on your local resources (which is a common pattern if you use the angular framework). If this is the case, you’ll also need to use a third-party plugincordova-plugin-wkwebview-file-xhr@2.1.4
Note the plugin version, their latest version is only forcordova-ios@6
and later.This won’t be a long term solution, as time goes on, changes will likely be required to support newer xcode versions, and these generally aren’t backported to older versions. But this should work for awhile.
I’m getting a consistent error 65, that starts with this error:
In the end I get:
Closing this issue as the OP’s issue had to deal with the change in build system where older cordova-ios versions had to use the legacy build system.
cordova-ios@6
supports the new build system, so changing to legacy shouldn’t be required anymore.See the SO accepted answer for more info.