Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use cordova platform add ios on windows - xcode error 66 is returned during the subsequent cordova build on macOS #971

Closed
3 tasks done
stevenmldn opened this issue Aug 21, 2020 · 2 comments · Fixed by #1312

Comments

@stevenmldn
Copy link

stevenmldn commented Aug 21, 2020

Bug Report

Cannot use cordova platform add ios on windows

Problem

Added an ios platform on a windows box results in the file containing the wrong slash type, backslashes rather than forward-slashes.

What is expected to happen

Adding the platform on macOS includes the following line the the xcode project file
301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = ""; };

Notice the slash in the path

What does actually happen?

Adding the platform on windows includes the following line the the xcode project file
301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib\CordovaLib.xcodeproj; sourceTree = ""; };

Notice the slash in the path

The project fails to open in xcode. The following error is returned when attempting to build via corodva-cli
stderr:
'2020-08-20 14:22:02.768 xcodebuild[32234:997204] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 75. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.\n2020-08-20 14:22:02.768 xcodebuild[32234:997204] Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}\n2020-08-20 14:22:02.768 xcodebuild[32234:997204] [MT] IDEFileReferenceDebug: [Load] <IDEFileReference, 0x7fad238295e0: name:xxx path:group:xxx.xcodeproj> Failed to load container at path: /Mobile/platforms/ios/xxxxxx.xcodeproj, Error: Error Domain=Xcode3ProjectErrorDomain Code=2 "The project ‘xxx’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.\n\nPath: Mobile/platforms/ios/xxxxxx.xcodeproj" UserInfo={NSLocalizedDescription=The project ‘xxx’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.\n\nPath: /Mobile/platforms/ios/xxx.xcodeproj}\n--- xcodebuild: WARNING: Unable to open project file '/Mobile/platforms/ios/xxx.xcodeproj' in workspace 'xxx.xcworkspace'.\n2020-08-20 14:22:02.862 xcodebuild[32234:997374] DVTProvisioningProfileManager: Failed to load profile "///Library/MobileDevice/Provisioning Profiles/Old" (Error Domain=DVTProvisioningProfileSourceErrorDomain Code=0 "No provisioning profile provider found for profile "///Library/MobileDevice/Provisioning Profiles/Old"." UserInfo={NSLocalizedDescription=No provisioning profile provider found for profile "///Library/MobileDevice/Provisioning Profiles/Old".})\n2020-08-20 14:22:03.021 xcodebuild[32234:997377] CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer implemented and should not be called\nxcodebuild: error: Scheme xxx is not currently configured for the archive action.\n\nxcodebuild: Command failed with exit code 66\n' }

Command or Code

cordova platform add ios on Windows
cordova build ios on macOS

Environment, Platform, Device

Adding the ios platform on Windows 10, copying to a mac and building there

Version information

on both the windows and macOS boxes, we are using
Cordova - v10

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@stevenmldn stevenmldn changed the title Cannot use cordova platform add ios on windows - xcode error 66 is returned during the cordova build Cannot use cordova platform add ios on windows - xcode error 66 is returned during the subsequent cordova build on macOS Aug 21, 2020
@breautek
Copy link
Contributor

iOS platform and commands are only supported on Macs, as documented here

However, I think maybe the CLI should actually tell you that if you try to use cordova platform add ios in an unsupported environment.

copying to a mac and building there

It's also not recommended to copy platforms/ directories in between environments. The same for the plugins/ directory. These two directories should be ignored in your version control system.

Instead, you can clone your project on the mac environment, then use cordova platform add ios to add the ios project. This will also download all the plugins and node_modules required by the ios project & their plugins, some of which may have native binaries that wouldn't be installed correctly if you just simply copied your entire project over.

Hope this helps to not only point out the "what", but also the "why" what you're attempting to do won't work.

However, I think maybe the CLI should actually tell you that if you try to use cordova platform add ios in an unsupported environment.

For this reason, I'll leave the ticket open.

@AdamLak
Copy link
Contributor

AdamLak commented Nov 5, 2020

You can run cordova prepare ios on any platform, but build only runs on macOs.
You need Xcode to build your prepared iOS project.

Just transfer the platform/ios folder to your macbook and run the pod install --repo-update, then build with Xcode.

#1018

dpogue added a commit to dpogue/cordova-ios that referenced this issue Apr 15, 2023
Cordova-iOS requires macOS for building and deploying, but it seems to
be a fairly common problem that people generate the iOS project files on
Windows (which isn't technically supported, but _appears_ to work) and
then Xcode can't open it on macOS because of a bad path separator.

The path separator problem is fixable, so let's at least generate a
valid Xcode project.

This does *not* claim to add support for using Cordova-iOS on Windows.

Closes apache#971.
Closes apache#1016.
Closes apache#1084.
dpogue added a commit to dpogue/cordova-ios that referenced this issue Apr 15, 2023
Cordova-iOS requires macOS for building and deploying, but it seems to
be a fairly common problem that people generate the iOS project files on
Windows (which isn't technically supported, but _appears_ to work) and
then Xcode can't open it on macOS because of a bad path separator.

The path separator problem is fixable, so let's at least generate a
valid Xcode project.

This does *not* claim to add support for using Cordova-iOS on Windows.

Closes apache#971.
Closes apache#1016.
Closes apache#1084.
dpogue added a commit that referenced this issue May 17, 2023
Cordova-iOS requires macOS for building and deploying, but it seems to
be a fairly common problem that people generate the iOS project files on
Windows (which isn't technically supported, but _appears_ to work) and
then Xcode can't open it on macOS because of a bad path separator.

The path separator problem is fixable, so let's at least generate a
valid Xcode project.

This does *not* claim to add support for using Cordova-iOS on Windows.

Closes #971.
Closes #1016.
Closes #1084.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants