Nativescript-cli: tns publish fails on new Mac - code-signing issue?

Created on 2 Nov 2017  Â·  4Comments  Â·  Source: NativeScript/nativescript-cli

Please, provide the details below:

I just moved from one Mac to another. This one runs Sierra and I just set up all the NativeScript components on it. I copied the code (app directory and everything related, NOT the Xcode files) from my old machine to this one, ran it - all OK in the simulator. Now, I try to publish a build and the process fails, as follows:

=== BUILD TARGET myappname OF PROJECT myappname WITH CONFIGURATION Release === Code Signing Error: Signing for "myappname" requires a development team. Select a development team in the project editor. Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1' Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1' Warning: Multiple build commands for output file /Users/apple/Library/Developer/Xcode/DerivedData/myappname-cdlhzpsgzserlxbesufbjmnlkeyt/Build/Intermediates.noindex/ArchiveIntermediates/myappname/InstallationBuildProductsLocation/Applications/myappname.app/Frameworks/TelerikAppFeedback.framework Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'

So I edited build.xcconfig and added in my Team ID there, as the value for DEVELOPMENT_TEAM. Now, when I run the same command (tns publish ios ), I get this different error:

=== BUILD TARGET myappname OF PROJECT myappname WITH CONFIGURATION Release === error: open /Users/apple/Library/Developer/Xcode/DerivedData/myappname-cdlhzpsgzserlxbesufbjmnlkeyt/Build/Intermediates.noindex/ArchiveIntermediates/myappname/InstallationBuildProductsLocation/Applications/myappname.app/Frameworks/TelerikAppFeedback.framework/_CodeSignature/CodeResources: No such file or directory ** ARCHIVE FAILED ** Command xcodebuild failed with exit code 65

What can I do to fix this? I don't want to go back to using Xcode. I assume there's a way to edit some files somewhere to make all this work OK. Any help appreciated!

Did you verify this is a real problem by searching [Stack Overflow]

Yes, I've looked on StackOverflow and on discussions here. There are peripheral references to the xcconfig file, etc. But nothing even close to my problem.

Tell us about the problem

I went online and revoked the certificate to the other Mac, just in case tns was being network-aware. Made no difference.
I also tried tns variations like building an ipa (tns prepare ios -provision). All comes back to same issue: can't code-sign (I guess).

Which platform(s) does your issue occur on?

OS X 10.13.1 (High Sierra)
For iOS

Please provide the following version numbers that your issue occurs with:

This is what I have as far as the environment goes:

Component│Current version
------------|----------------
nativescript | 3.2.0
tns-core-modules | 3.3.0
tns-android│ 3.2.0
tns-ios│ 3.2.0
tns | 3.2.0

Please tell us how to recreate the issue in as much detail as possible.

As described above.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No, it all works OK, just the publishing fails.

question

Most helpful comment

@dtopuzov, thank you for that pointer - I tried that unsuccessfully, but finally did the following, to make it all work:

  1. Ran tns build ios --release --for-device --provision, got the provision IDs (there were two), identified the one I wanted to use
  2. Then: tns platform remove ios
  3. Then: tns platform add ios
  4. Then: tns run ios --provision <my provision uuid>
  5. Opened the workspace file (created in step 4 above) in Xcode
  6. Checked "Automatically manage signing" on the General tab, selected my team in the dropdown
  7. On the Build Settings tab, set the Code Signing Identity to my iPhone Developer identity; also set the Code Signing Style, etc. to Automatic
  8. Went back to the General tab and unselected "Automatically manage signing", reselected it (yep, Xcode 9 is that f**ed up)
  9. Went back to the command line and ran tns publish ios <my Apple Dev ID> <my Apple Dev password>.

Of course, if there's a better way to do this, would love to hear. Also, would love to see the tns script filling out the workspace file more in line with Xcode's expectations, but maybe I'm asking for too much.

Regardless, this all worked out. Thanks!

All 4 comments

Hi @nmandyam

What version of Xcode you use and what is the exact command you run?

Can you please try to tns build ios --release --for-device --provision, it will list all available provisioning profiles on your machines, then you can select one and rerun command specifying the provision you want.

@dtopuzov, thank you for that pointer - I tried that unsuccessfully, but finally did the following, to make it all work:

  1. Ran tns build ios --release --for-device --provision, got the provision IDs (there were two), identified the one I wanted to use
  2. Then: tns platform remove ios
  3. Then: tns platform add ios
  4. Then: tns run ios --provision <my provision uuid>
  5. Opened the workspace file (created in step 4 above) in Xcode
  6. Checked "Automatically manage signing" on the General tab, selected my team in the dropdown
  7. On the Build Settings tab, set the Code Signing Identity to my iPhone Developer identity; also set the Code Signing Style, etc. to Automatic
  8. Went back to the General tab and unselected "Automatically manage signing", reselected it (yep, Xcode 9 is that f**ed up)
  9. Went back to the command line and ran tns publish ios <my Apple Dev ID> <my Apple Dev password>.

Of course, if there's a better way to do this, would love to hear. Also, would love to see the tns script filling out the workspace file more in line with Xcode's expectations, but maybe I'm asking for too much.

Regardless, this all worked out. Thanks!

I am having a similar issue. But when I run tns build ios --release --for-device --provision I get:

ENOENT: no such file or directory, scandir '/Users/charlesdupont/Library/MobileDevice/Provisioning Profiles/'

@cadupont23 have you downloaded your provisioning profiles? (here)

Closing this one as the reported issue is resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerbob92 picture jerbob92  Â·  3Comments

DimitarTachev picture DimitarTachev  Â·  3Comments

leevigraham picture leevigraham  Â·  3Comments

Anilinfo2015 picture Anilinfo2015  Â·  3Comments

PeterStaev picture PeterStaev  Â·  3Comments