Skip to content

Manual signing with distribution provisioning profile fails with NS 2.5 #2501

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

Closed
dbenninger opened this issue Feb 7, 2017 · 12 comments
Closed

Comments

@dbenninger
Copy link

dbenninger commented Feb 7, 2017

When specifying the provisioning profile with the new command line parameter "--provision", the "CODE_SIGN_IDENTITY = iPhone Distribution" in build.xcconfig is ignored and "iPhone Developer" is used. The xcode build fails with the error message 'Provisioning profile "" doesn't include signing certificate "iPhone Developer: ..."' because it cannot find a developer certificate for the adhoc distribution provisioning profile.

To reproduce:

  1. Use NS 2.5 to create a test app: tns create "SignTest" --ng
  2. In the file app/App_Resources/iOS/build.xcconfig, enable CODE_SIGN_IDENTITY = iPhone Distribution;
  3. Create an adhoc distribution provisioning profile for your SignTest app id and link it to your distribution certificate
  4. Install the distribution provisioning profile and distribution certificate locally
  5. Run the build with: tns build ios --release --for-device --provision (UUID)
  6. The build fails with: Provisioning profile "..." doesn't include signing certificate "iPhone Developer: ..."

Manually editing the generated project.pbxproj and replacing "iPhone Developer" with "iPhone Distribution" solves the issue.

Opening the generated project settings in xcode shows you the same error message:
xcode

@PanayotCankov PanayotCankov self-assigned this Feb 7, 2017
@ghost
Copy link

ghost commented Mar 31, 2017

Confirmed.

@patrickpereira
Copy link

Any fixes for this one?

@spike1292
Copy link

having the same problem.
is there a workaround?

@ghost
Copy link

ghost commented Apr 6, 2017

@patrickpereira @spike1292 Edit lib/services/ios-project-service.js.

Find:
identity: mobileprovision.Type === "Development" ? "iPhone Developer" : "iPhone Distribution"

Replace with:
identity: !process.env.CODE_SIGN_IDENTITY ? (mobileprovision.Type === "Development" ? "iPhone Developer" : "iPhone Distribution") : process.env.CODE_SIGN_IDENTITY

Then pass the CODE_SIGN_IDENTITY env variable to your build command.

@pkoleva
Copy link
Contributor

pkoleva commented Apr 6, 2017

Hey guys, sorry for not updating you. We haven't got the time to fix this with all the improvements around 3.0.0 RC. We'll consider it for a future release. I also have the same issue and am constantly reminding about it :). For now I recommend you to not use this option and as a workaround set PROVISIONING_PROFILE = <name > in build.xcconfig.

@spike1292
Copy link

@pkoleva thank you for the update, will try to use the PROVISIONING_PROFILE workaround.
We where using PROVISIONING_PROFILE_SPECIFIER but this is not working any more, any chance you will also support the specifier?

@PanayotCankov
Copy link
Contributor

@dbenninger once you use --provision it sets the provision's attributes in the pbxproj and they have higher precedence than the xcconfig. The --provsion should be able to use distribution certificates since #2705. If there is high demand we can either clear the pbxprj if no "--provision" is used or provide special option like "--provision -" or something that would clear its effect. The current design is to allow "tns prepare ios --provsion MyDevProfile" to be called once and skip the --provision flag in subsequent interactions with the CLI during development.

PROVISIONING_PROFILE_SPECIFIER should be good to go again with #2705, we used to check if the xcconfig has PROVISIONING_PROFILE and switch to manual signing mode if it was specified. I've added checks for the specifier too.

@spike1292
Copy link

@PanayotCankov tested --provision with nativescript@next. It works with developer profiles & App Store profiles. But not with adhoc profiles.

tns prepare ios --bundle --provision "match AdHoc nl.energiedirect.selfserviceapp" --release

when I open xcode I see this:
screen shot 2017-05-23 at 14 42 59
when I check the provision profile it looks fine:
screen shot 2017-05-23 at 14 41 03

to be sure I just cleaned my /Users/me/Library/MobileDevice/Provisioning Profiles folder

so now I can't run my adhoc builds with a ci server, because of the manual interaction.

@vchimev vchimev assigned vchimev and unassigned vchimev Jun 19, 2017
@pkoleva pkoleva modified the milestones: 3.2.0, 3.1.0 Jun 29, 2017
@ghost
Copy link

ghost commented Jul 15, 2017

@PanayotCankov @pkoleva Really hope this is in 3.2.0

@dtopuzov
Copy link
Contributor

dtopuzov commented Aug 14, 2017

@vbresults @spike1292 @patrickpereira @dbenninger

This should be fixed in nativescript@next

Can you please try:

npm un -g nativescript
npm cache clean
npm i -g nativescript@next
tns build ios --provision <id> --release --for-device

Please let us know if you still encounter some issues.

@pkoleva pkoleva removed this from the 3.2.0 milestone Aug 15, 2017
@PanayotCankov
Copy link
Contributor

When --provision is used, there should be no signing or provisioning switches configured manually in the build.xcconfig. If you have configured the build.xcconfig use the tns commands without --provision. These are mutually exclusive for the moment.

Providing --provision with development or distribution certificate will set the proper code signing in the pbxproj now.

@dtopuzov
Copy link
Contributor

I can confirm signing with distribution provisioning works in @next and it will be officially released in [email protected].

As @PanayotCankov explained above, --provision is mutually exclusive with provisioning switches configured manually in the build.xcconfig

@vbresults @spike1292 @patrickpereira @dbenninger
Please let us know if you still encounter some issues.

@dtopuzov dtopuzov added this to the 3.2.0 milestone Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants