Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

building iOS no longer working after updating XCode from 8.2 to 8.3 #26

Closed
strille opened this issue Apr 4, 2017 · 66 comments
Closed
Assignees
Labels

Comments

@strille
Copy link

strille commented Apr 4, 2017

When running remotebuild (version 2.1.3) on a Mac with XCode 8.2, a deprecation warning was shown:

PackageApplication is deprecated, use xcodebuild -exportArchive instead.

After updating to XCode 8.3 it seems this feature was removed altogether, because now the log shows:

xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

It looks like remotebuild needs to be updated to use xcodebuild instead of xcrun.

@domisginger
Copy link

domisginger commented Apr 4, 2017

I agree changing src > taco-remote-lib > ios > iosBuild.ts line 90 from

child_process.exec("xcrun -v -sdk iphoneos PackageApplication " + pathToCordovaApp + " -o " + fullPathToIpaFile, {},

to

child_process.exec("xcodebuild -sdk iphoneos -exportArchive -archivePath" + pathToCordovaApp + " -exportPath " + fullPathToIpaFile, {},
then recompiling and installing back on the mac worked for me (although the plist is now always generated as exportOptions.plist instead of appName.plist

*Updated as i realised I duplicated the fix instead of before & after

@feloniuosgru
Copy link

Just ran into the same issue. I am using TFS build step to create package and ran into this issue:
xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH /usr/bin/xcrun failed with return code: 72 Return code: 1

@Willovent
Copy link

This is really annoying since with Xcode 8.2.x we can't deploy on IOS 10.3.x and with Xcode 8.3 remotebuild doesn't work.

@drewgillies
Copy link
Member

This is our number one issue right now, @Willovent. No ETA yet, but we're on it. Totally understand the annoyance factor.

@AnBucyk
Copy link
Contributor

AnBucyk commented Apr 27, 2017

Fixed in PR #27, But there's still some process to go through to get it localized and published.

@darrenschwarz
Copy link

I am relatively new to IOS development, and having spent the time setting up my provisioning profile, configuring remotebuild, fixing the issues with xcode recognising my provisioning profile, I thought I was there when VS output showed 1> ** BUILD SUCCEEDED **., only to get....

xcrun : error : unable to find utility "PackageApplication", not a developer tool or in PATH

I am using Visual Studio, to deploy a Cordova project, via remotebuild , on OS 10.3.x with Xcode 8.3.

Can you give a brief explanation as to what will need updating / how to go about it, when a fix is released. Thanks

@rvfede
Copy link

rvfede commented May 3, 2017

Hi Guys!
No news about this issue?
Do you have an idea about when the fix will be available?
We can wait a couple of days, after that we should try somenthing. Do you think if we downgrade the XCode we will be able to keep going for a while?
Thanks.

@jlyshoel
Copy link

jlyshoel commented May 3, 2017

@rvfede I dont' have any news, seems that they are working on it and a fix is soon to be released.

I can offer a workaround that worked for me. If you downgrade to XCode 8.2, you are able to build and run apps from Visual Studio. However, XCode 8.2 doesn't support iOS 10.3. If you move/copy the 10.3 "supported deviced" folder from an unpacked version of XCode 8.3, you are good to go.

I was able to build apps using this method, but there are major problems running them from Visual Studio. Probably because xcrun doesn't really support iOS 10.3. If you click "run" in Visual Studio, your app will get deployed, but doesn't start and Visual Studio doesn't ever complete the build process. You'll have to cancel it manually and start the app manually on your device.

More on how to get Xcode 8.2 and iOS 10.3 to work together here; https://gist.github.com/steipete/d9b44d8e9f341e81414e86d7ff8fb62d

To make sure your mac is setup correctly, you can use Xcode and create a blank project to deploy. If you are able to deploy to iOS 10.3 and Xcode 8.2 it should also partly work using remotebuild.

This is the best solution I could come up with, it got me through the final stages of development and release, but it's useless if you wan't to debug and test. Hope it this may be of some help.

@rvfede
Copy link

rvfede commented May 4, 2017

@jlyshoel many thanks for the detailed explanation, it was really helpful, at lest I am able to build for iOS again (not yet with the iOS 10.3, I will try the work around later).

Now, a doubt...
If I build and send a new release to the store using XCode 8.2, will it be available for all iOS devices or 10.3 will be automatically excluded?

Thanks.

@jlyshoel
Copy link

jlyshoel commented May 4, 2017

@rvfede Glad I could be of some use. I understand your trepidation with regards to releases, and I had the same thought myself.

I can happily report that we just released an app to App Store this morning, and a non-tech colleague of mine installed it on his iPhone with iOS 10.3 from App Store just after release. I did install it from app store on my dev device, which is also running 10.3. By that logic I'm currently working under the theory that it works for everyone, until I'm proven wrong 🥇

With that said, I've only tried with Xcode 8.2 setup to also include support for 10.3. I'm not sure what happens if you release a build without that hack, but my assumption is that is doesn't create any problems anyway. Newer devices should in theory be able to run older code, only Xcode 8.2 that is missing a way to communicate with iOS 10.3. (My interpretation).

@AnBucyk
Copy link
Contributor

AnBucyk commented May 4, 2017

@rvfede Looks likely that we'll have something released in a couple hours.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 4, 2017

@rvfede Quick update. We're waiting on one last set of localized strings. Worst case, we release tomorrow afternoon with a temporary gap in localization for Japanese.

@ekambarrao
Copy link

Any update about this fix!!

@rvfede
Copy link

rvfede commented May 5, 2017

Thanks @AnBucyk ! Will be waiting for it.

I am sure you are already aware of this, but just in case, just to let you know.
I just upgrade to VS 2017 and always when I send a remotebuild request from VS2017 it always fail with the message "The operation has timed out" BUT... if request is sent from VS2015 it works fine.

Thank you again.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 5, 2017

@ekambarrao We're waiting for one last set of localized strings. We're publishing today with or without them so we can get this fix out.

@rvfede There's another issue thread tracking timeouts, but I think that's VS2015 that's timing out in that thread. I can't repro 2017 timing out (my fix for this issue was tested in 2017). If you can give more details (logs, etc), feel free to add it to the existing issue.

@rvfede
Copy link

rvfede commented May 5, 2017

@AnBucyk, I just found that the "time out" problem I was having was related to my project and has nothing to do with the remotebuild. My fault, I am sorry.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 5, 2017

No worries, @rvfede

This fix should be published. I'm closing this issue for now. :)

@AnBucyk AnBucyk closed this as completed May 5, 2017
@DarrylLeckenby
Copy link

How is this fix being delivered? I just tried a re-install remote build via npm on the mac but the version number has not changed from my current version (2.1.3). What am I missing?

@BigFoppa
Copy link

BigFoppa commented May 6, 2017

Guess something did change after "npm install". Now I am getting this error when building from Visual Studio:

"Error: Remote build error from the build server Build failed with error - 1"

Can successfully run using xcode. There was an error that development team was not set, but after that it worked.

@RLaptev
Copy link

RLaptev commented May 7, 2017

Same question as @DarrylLeckenby - how do we upgrade?
I ran nmp upgrade -g remotebuild. The version is still 2.1.3 after the upgrade.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 7, 2017

@RLaptev @DarrylLeckenby The fix was in taco-remote-lib and taco-remote-multiplexer. These should automatically be pulled down when a new build happens. If not, try deleting ~/.taco-home/node_modules/

@RLaptev
Copy link

RLaptev commented May 8, 2017

@AnBucyk - thank you!
Removing ~/.taco-home/node_modules/ did the trick. The "PackageApplication" error is gone. However, I still can't build the app.... No specific error this time, just this:

MSBUILD : cordova-build error : Remote build error from the build server http://199.204.150.52:3000/cordova - Build failed with error

The last entries in VS2017 are not helpful:

...
Checking config.xml for saved plugins that haven't been added to the project
Saving ios@4.2.0 into platforms.json
No scripts found for hook "after_platform_add".
Failed to build app for buildNumber 22524:
1>Done building project "foo.jsproj" -- FAILED.

No specific error is provided. Do I need to enable extra logging in order to troubleshoot this?

Thank you!

@jlyshoel
Copy link

jlyshoel commented May 8, 2017

@RLaptev Got the exact same issue. I'm able to build and run directly from Xcode, but not using remotebuild+VS. I would agree that the last lines from VS isn't very helpful. Not sure if there is a verbose mode, maybe @AnBucyk could help us out here?

I did remove the taco_home directory to get remotebuild to update, which for me did removed the PackageApplication error. I also did upgrade of xcode and xcode cli tools and reinstall of remotebuild. Didn't help.

Just for fun, I ran "remotebuild test" on my mac, which also failed. It contains a lot more info than VS and throws an exeption from remotebuild. Thereabout is probably the root of the problem. I haven't yet figured out if it's a bug in remotebuild or something in the mac setup. Unfortenantly I won't have time to look more in detail at it today. Maybe it helps @RLaptev in your troubleshooting.

@jlyshoel
Copy link

jlyshoel commented May 8, 2017

BTW; it's the same exception mentioned here: #7

@cannvand
Copy link

cannvand commented May 8, 2017

@jlyshoel @RLaptev I'm getting the exact same error, logging in VS is useless.

Prepared iOS project successfully
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
Saving ios@4.3.1 into platforms.json
No scripts found for hook "after_platform_add".
Failed to build app for buildNumber 2469:
1>Done building project "testProject.jsproj" -- FAILED.

Any idea on how to fix this issue?

@ekambarrao
Copy link

ekambarrao commented May 8, 2017

HI, what is the current version of new release of remotebuild? I have macincloud and it has xcode 8.3.1 and ios 10.3.1 and remotebuild version 2.1.2. I am using ios@4.3.1 inside config.xml. It is giving the same error as earlier one with "packageapplication". New release with such a huge negative impact is really unbelievable!!!

@AnBucyk
Copy link
Contributor

AnBucyk commented May 8, 2017

@RLaptev @jlyshoel I'm not seeing the error with my setup, so I'd need a full log. When you do a build, there should be a full log saved on your Mac at ~/.taco_home/remote-builds/taco-remote/builds/[build number]/build.log. If you could send me that, I'd appreciate it. Also, since it's the same exception mentioned in #7, does the solution for that issue also work? Or is it the same exception without a solution?

@cannvand Same as above, I need a full log. You can find it at ~/.taco_home/remote-builds/taco-remote/builds/[build number]/build.log.

@ekambarrao The current version of remotebuild is 2.1.3. If you're trying to take this fix specifically, you need to clear the node_modules cached at ~/taco_home/node_modules/. This should cause remotebuild to immediately look for new versions of taco-remote-lib and taco-remote-multiplexer. Let me know if you still have issues when you try this.

@BigFoppa
Copy link

BigFoppa commented May 9, 2017

@RLaptev try to uninstall and install previous version
npm uninstall -g cordova
npm install -g cordova@6.5.0

But you need to use later version of the ios platform as it states to fix issues with xcode 8.3.2 and I guess that remotebuild needs that.

I am using cordova 6.5.0 and ios 4.4.0. Cordova 7.0 is the latest release which I have not tried yet in my project.

@jlyshoel
Copy link

jlyshoel commented May 9, 2017

Got the same issue as @RLaptev, but I noticed that my project was using 6.3.1 in my project,
project

I then did as admin on my workstation:

npm install -g cordova

And on the Mac, based on the feedback from remotebuild

npm install -g ios-deploy

That seems to have fixed the build problems. However, my app doesn't start on the phone, so I'm sort of back to where I was a week ago running a "hacked" version og Xcode 8,2.

@RLaptev You get the same error?

@cannvand
Copy link

cannvand commented May 9, 2017

@AnBucyk Worked like a charm.
Ran this command on the MAC

sudo install -g cordova

This installed cordova 7.0.0 globaly.
Tried to build using VS and it worked.
Note on my windows workstation I have cordova 6.5.0 globaly installed.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 9, 2017

@cannvand Glad it worked for you. I'll have a fix soon so that you no longer need a globally installed cordova, but that should work in the meantime.

@jlyshoel You can override the versions of cordova, tools and platforms by selecting "Global" for your toolset, and then manually installing the tools you need. The idea of the 6.3.1 toolset is it's a known, good configuration that should work out-of-box. The only caveat here is that the 6.3.1 toolset doesn't support remotebuild w/ Xcode 8.3 unless you edit config.xml manually to use cordova-ios 4.3.0 or greater.

@RLaptev Great, I'm glad you're seeing that error. That's expected. The minimum cordova-ios version we support with Xcode 8.3 is now 4.3.0 or greater. As above, you should be able to manually edit your config.xml to specify cordova-ios to be 4.3.0, and your build should succeed.

@BigFoppa The error you're seeing is something I'd expect if the project is using libimobile to deploy to a device, and so far as I know, we only use that for the Local Deploy feature in Visual Studio. I could be wrong about this, though - I'm pretty new to this codebase. Regardless, the error you're getting looks unrelated. Feel free to open a new issue for this if you want us to investigate it further.

@jlyshoel
Copy link

jlyshoel commented May 9, 2017

@AnBucyk That solved the build problem, but still unable to actually run the application on the phone. It gives a HTTP 404 on /deploy

2>------ Deploy started: Project: Fernerbonus, Configuration: Debug iOS ------
2>Requesting deploy on remote iOS device for buildNumber 3795 on server http://10.0.11.125:3000/cordova...
2>http://10.0.11.125:3000/cordova/build/3795/deploy The remote server returned an error: (404) Not Found.

Any idea if this is related?

@AnBucyk
Copy link
Contributor

AnBucyk commented May 9, 2017

@jlyshoel Physical device or simulator? Sometimes it takes a moment for the simulator to boot and it 404's if you're too quick. Try again once it's booted? If it's a device, I'm not sure, and we'll need to investigate.

Regardless, it's probably not related (this fix only really effects signing/packaging, not deploying. Feel free to file a new issue.

@BigFoppa
Copy link

BigFoppa commented May 9, 2017

@AnBucyk When you say Local Deploy do you mean in VS2015 building for Local Device?
No, I am building for Remote Device on my mac.

@ekambarrao
Copy link

@AnBucyk, seeking help ....this totally made me go nuts now with no clue about which version is compatible to what to get this build successful.

I am still getting the same error. VS2015/2017, Cordova 6.5/6.3, ios 10.3, xcode 8.3.1 remotebuild 2.1.3
ios is ~4.3.1 in config


1>MSBUILD : cordova-build error : xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
1>xcrun : error : unable to find utility "PackageApplication", not a developer tool or in PATH
1>MSBUILD : cordova-build error : - 1
1> - {1}

if I use cordova 7.0 in vs 2015 and build it,

I am getting another weird error


No scripts found for hook "before_platform_add".
1> Removing "cordova-" prefix from cordova-ios
1> Adding ios project...
1> Error PlatformApi not loaded for platform.SyntaxError C:\Users\Ekambarrao.cordova\lib\npm_cache\cordova-ios\4.4.0\package\bin\templates\scripts\cordova\lib\plugman\pluginHandlers.js:99
1> let opt = { customFramework: false, embed: false, link
1> ^^^
1> Unexpected strict mode reserved word
1>MSBUILD : cordova-build error : Error: Your ios platform does not have Api.js
1> Error Your ios platform does not have Api.js

@cannvand
Copy link

cannvand commented May 9, 2017

@ekambarrao did you try removing the node_modules folder? this should fix the first error, the second one I cannot explain.

@RLaptev @DarrylLeckenby The fix was in taco-remote-lib and taco-remote-multiplexer. These should automatically be pulled down when a new build happens. If not, try deleting ~/.taco-home/node_modules/

@BigFoppa
Copy link

BigFoppa commented May 9, 2017

@cannvand Did you ever see the deploy 404 error?

@AnBucyk using "cordova run --device" in the {build-number}/cordovaApp folder successfully deploys and runs the app on my iPhone 5s device.

@ekambarrao
Copy link

@cannvand, thx for help. it gave me ipa.

@cannvand
Copy link

cannvand commented May 9, 2017

@BigFoppa No i've never seen the deploy 404 error. Looks like the build succeeds but VS is unable to copy the .ipa.
If you browse to the folder on the mac do you see the .ipa file?

@Adavo
Copy link

Adavo commented May 9, 2017

Just wanted to insist that is important to:

  • install latest version on windows : npm install -g cordova
  • configure VS to use cordova 7.0.0 (on config.xml, in the platforms tab. If you don't see it, just change taco.json to 7.0.0)
  • install latest cordova on mac : npm install -g cordova
  • install on mac the latest version of ios-deploy : npm install ios-deploy
  • remove the folder ~/.taco-home/node_modules/
  • install the latest remotebuild on mac : npm install remotebuild (it should be 2.1.3).

And it works !

@BigFoppa
Copy link

BigFoppa commented May 9, 2017

@cannvand Yes the .ipa file is there. And it is also copied to the pc.

@RLaptev
Copy link

RLaptev commented May 9, 2017

@AnBucyk running npm install -g ios-deploy on Mac solved the cordova-ios 4.3.0 version requirement error. However, I still can't fully compile:
Snippet of the error:

Can't find any applicable signing identities for items
Error Domain=IDECodesignResolverErrorDomain Code=10 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No valid 'ad-hoc' profiles were found., NSLocalizedDescription=No matching provisioning profiles found,

My build.json contains the following:

  "ios": {
    "debug": {
      "developmentTeam": "XXX",
      "provisioningProfile": "64B49D46-E09B-42F4-9BDC-7F66A852C3CF"
    },
    "release": {      
      "developmentTeam": "XXX",
      "provisioningProfile": "7C831EED-C5BB-4339-9260-C04BBCC70EAD",
      "packageType": "ad-hoc"
    }
  }

The above error comes at what seems like almost the end of the compilation.
I know XCode has access to this provisioning profile as it prompted me to confirm access permissions during the remote build.
If I remove provisioningProfile from build.json then compilation fails with Could not find development team error right from the start.
I have Remove Device as target selected in VS when doing the build.
The installed on Mac provisioning profile is for In House App Development, since the app is for internal use and will not be uploaded to Apple store.

@AnBucyk
Copy link
Contributor

AnBucyk commented May 9, 2017

@RLaptev I think the error you're seeing is one that I was seeing before I had a valid provisioning profile on the build machine. Made sure your provisioning profile is installed and your App ID applies? To be clear, this is an Apple thing, not a remotebuild thing. Personally, I had to manually download and install my provisioning profile to ~/Library/MobileDevice/Provisioning Profiles to get it to work.

configure VS to use cordova 7.0.0 (on config.xml, in the platforms tab. If you don't see it, just change taco.json to 7.0.0)

@Adavo This is NOT the way I'd recommend doing this. Cordova 7.0.0 isn't required (or officially supported yet). If you want to use it, I highly suggest switching your toolset to Global and installing your dependencies manually (Including Cordova).

@BigFoppa Please open a new issue for your 404 error - I'm not going to try to debug it in the comment thread for an unrelated issue anymore.

Everyone else - Please try the following things if you're still having issues. Anything unrelated specifically to this issue should have its own issue thread - feel free to create one.

  • Clear ~/.taco_home/node_modules
  • Install cordova (any version) globally on your build machine (Temporary workaround, fix coming soon)
  • If you're using Xcode 8.3, ensure the cordova-ios platform version is 4.3.0 or newer.

@RLaptev
Copy link

RLaptev commented May 9, 2017

@AnBucyk the profiles were in the right places. I had to add packageType to build.json to finally compile the app. All good now!

"ios": {
  "debug": {
    "developmentTeam": "XXX",
    "provisioningProfile": "64B49D46-E09B-42F4-9BDC-7F66A852C3CF"
  },
  "release": {
    "codeSignIdentity": "iPhone Distribution",
    "developmentTeam": "XXX",
    "provisioningProfile": "7C831EED-C5BB-4339-9260-C04BBCC70EAD",
    "packageType": "enterprise"
  }
}

@BigFoppa
Copy link

BigFoppa commented May 10, 2017

@AnBucyk Thank you for your efforts! At least I can build now and run with xcode.
I totally understand that you want to separate my deploy issue from your work with the build. I will later file an issue for this, just a bit busy right now (aren't we all :-)...

@RLaptev I believe that "packageType" for "release" should be "app-store" and for "debug" it should be "development".

@BigFoppa
Copy link

And @Adavo installing Cordova 7 on my machine with VS2015 was a mistake. All hell broke loose, especially trying to build for android. Guess many plugins are not ready for this upgrade. Took me a while to clean up and be back to square 1.

@RLaptev
Copy link

RLaptev commented May 10, 2017

@BigFoppa - in my case for in-house app packageType needs to be enterprise for release. thanks.

@ekambarrao
Copy link

ekambarrao commented May 15, 2017

Hi @AnBucyk , I have Visual Studio 2017 and used Cordova 7.0 and ios 8.3.1 and Mac 10.X. I am able to successfully build the solution and getting the ipa and plist. Now I am held up at publishing to store. It is giving error as

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

and I have gone through all the link available and does all mentioned in several posts found it be not resolving the issue. Any suggestion? Note: I know that this not remotebuild issue to add here in this 'thread' but could not find a better place to mention about this than here.

@BigFoppa
Copy link

@ekambarrao
Copy link

I have used all options. like reinstalled the camera plugin and then included the config.xml tags etc. they are reflecting inside *-info.plist but when submitting to App Store, still getting the same error.

@stevecasey17
Copy link

Had this issue and to get past the remote build error had to open the remote build project in xcode on the remote build mac.
The signing certs were not correct.
Selected the correct signing certs in xcode.
Build and deployed via xcode without issue.
The remote build works now that the signing cert is correct.
Compared files on remote vs local build. No changes.
At least it is building , debug is another story.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests