Skip to content

Unable to tns publish ios #2922

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
briandilley opened this issue Jun 26, 2017 · 6 comments
Closed

Unable to tns publish ios #2922

briandilley opened this issue Jun 26, 2017 · 6 comments

Comments

@briandilley
Copy link

here's the command i'm using:

   echo "================ PREPARE ===============" && \
    tns prepare ios --provision ...redacted profile id... && \
    echo "================ PUBLISH ===============" && \
    tns publish ios ...redacted user... ...redacted password... ...redacted profile id... "iPhone Distribution"

My xcconfig:

// You can add custom settings here
// for example you can uncomment the following line to force distribution code signing
// To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;

DEVELOPMENT_TEAM = ...redacted team id...
CODE_SIGN_IDENTITY = iPhone Distribution: ...redacted company name ..., LLC (...redacted team id...)
PROVISIONING_PROFILE = ...redacted profile id...
APP_PROFILE = ...redacted profile id...

TARGETED_DEVICE_FAMILY = 1

CODE_SIGN_ENTITLEMENTS = quickridensmobile/quickridensmobile.entitlements

Build fails on the CI machine (Circle CI) with the following:

=== BUILD TARGET GTMSessionFetcher OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“App Store Provisioning Profile”) has an AppID of “com.gosuna.quickride.DriverApp” which does not match your bundle identifier “org.cocoapods.GTMSessionFetcher”.

=== BUILD TARGET PocketSocket OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“App Store Provisioning Profile”) has an AppID of “com.gosuna.quickride.DriverApp” which does not match your bundle identifier “org.cocoapods.PocketSocket”.

=== BUILD TARGET GoogleToolboxForMac OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“App Store Provisioning Profile”) has an AppID of “com.gosuna.quickride.DriverApp” which does not match your bundle identifier “org.cocoapods.GoogleToolboxForMac”.

=== BUILD TARGET Protobuf OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“App Store Provisioning Profile”) has an AppID of “com.gosuna.quickride.DriverApp” which does not match your bundle identifier “org.cocoapods.Protobuf”.

It used to work. And still works on my local environment(s) (laptop and workstation).

@PanayotCankov
Copy link
Contributor

PanayotCankov commented Jun 28, 2017

Hi,

This will not fix the signing problem, but have in mind that tns prepare ios --provision will set the provisioning profile you provide along with "Manual Signing Style" in the pbxproj in platforms/ios. It will be with higher precedence over the pbxproj settings, so in general you should either have the DEVELOPMENT_TEAM , CODE_SIGN_IDENTITY, PROVISIONING_PROFILE etc. in the xcconfig, or you should have none of them and configure the project using the --provision switch.

On the other hand we had similar problems with Cocoapods in the past. We were passing the signing identity and provisioning profile with flags to the underlying xcodebuild command, and since the build was multi-target build, it tried to sign and provision each and every target, including the pods. Now the pods obviously can not share the same id as your app, and trying to sign them and apply the distribution provisioning profile fails. The framework produced by the Cocoapod should not be signed during build. It should be signed by the app target when they are added to the app as embedded frameworks, and this will not apply the provisioning profile to them, it will just sign with the same certificate used for the app. Publishing either through the Xcode UI or through the {N} CLI involves building archive out of the project and then exporting the app (that is re-signed in the process) for distribution. So in general you should not use the .pbxporj nor --provision to set distribution sertificates or provisioning profiles when publishing, you can have the development certificates there (tns prepare --provision or xcconfig) and provide the distribution certificates to tns publish ios ... these will be used when the app is extracted from the archive. So to narrow things down:

  1. Use tns prepare --provision <with-development-provision> or set the xcconfig to use development certificate and provision

  2. Use tns publish ios <distribution certificate, provision etc.>, it will export the app with whatever xcconfig or --provision you provided first, and then it will extract app for App Store distribution using the distribution certificates.

  3. I don't know why the build tries to provision and sign the Cocoapods but chances are if you use a wildcard provision for development it will manage to provision the Cocoapods framework and strip the signature when exporting for distribution.

  4. Check the Cocoapods, ruby, python, node and tns versions on you CI machine, this may be an issue with the Cocoapod that may already be fixed.

@briandilley
Copy link
Author

I made this change, still no luck. I'll try with 3.1 today.

@briandilley
Copy link
Author

Still no luck

@briandilley
Copy link
Author

I noticed that tns prepare --provision XXX launches a simulator (but still works) on my local machine... i wonder if that's the problem on the CI machine

@briandilley
Copy link
Author

All of this works for me now after having removed the fabric plugin and the firebase plugin. Those plugins caused a number of issues for me that were resolved as soon as i removed them.

@dtopuzov
Copy link
Contributor

@briandilley

Happy to hear you resolved the problem.
If you think that issue is caused by specific plugin you can log the issue in plugin's repo.

btw, we had some issues with distribution and adhoc provisioning profiles that are fixed in nativescript@next so you can give it a try once again.

Steps:

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

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

4 participants