NativeScript / nativescript-remote-builds

A NativeScript plugin for remote builds when running and publishing NativeScript apps without env setup.
Apache License 2.0
26 stars 9 forks source link

IOS Build Failed #22

Closed mskourtelis closed 3 years ago

mskourtelis commented 3 years ago

Hi , I am trying to build an app from a win10 pc via circleci - fastlane pipeline. While my code compile with success on push when i send "ns build ios --for-device" i always receive this error which occur after ❌ error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "**" with a private key was found. (in target '*****) +------+----------------------------+-------------+ | fastlane summary | +------+----------------------------+-------------+ | Step | Action | Time (in s) | +------+----------------------------+-------------+ | 1 | Verifying fastlane version | 0 | | 2 | setup_circle_ci | 0 | | 3 | match | 2 | | 4 | ns | 74 | | 💥 | gym | 9 | +------+----------------------------+-------------+

rigor789 commented 3 years ago

Do you have the certificates in your match repo? Are they correct? ie. a development certificate & a production one (when running --release?)

mskourtelis commented 3 years ago

Hi rigor, Yes i am pretty sure that my certificates are correct. And of course i can see certs on repository. i double check this with match import and see that everything was uploaded seconds before (after nuke).BTW I use to nuke everything twice before i send this ticket. Also as you can see the match phase is complete with success . If something was not correct with type [development-appstore] and my repo i think that the crash sould be in match. There is always the posibility of a config error but i cannot resolve this

rigor789 commented 3 years ago

Issues with certs don't necessarily show up in the match step.

How did you generate the certs? (and was it generated on Windows?)

mskourtelis commented 3 years ago

Yes i work on win10. And this is my process on create certificates

  1. Create .key and .csr with openssl from my pc . next step
  2. Apple Developer Portal and create iOS App Development || Apple Development with the csr
  3. Back to windows\openssl and create pem with my new .cer
  4. Create p12 with .key and .pem [with password my match pass from remote env]
  5. Back to Apple and create identifier * profile with my Dev Cert

At this moment i have [.csr,.key,.cer,.pem,.p12,.mobileprovision] Then with match import i provide the path for cer , p12 , mobileprovision and that's it . fastlane ask for Apple Password and the everything ends fine.

rigor789 commented 3 years ago

Last time I tested, I wrote down the steps I did to get it to work: https://www.notion.so/Set-up-ios-signing-keys-from-Windows-bb40bca8804f4800a104a3976492a988

I believe there may be a difference with the openssl params that make it work.

mskourtelis commented 3 years ago

This is slightly different from my process openssl genrsa -out ms.key 2048 openssl req -new -sha256 -key ms.key -out ms.csr openssl x509 -inform DER -outform PEM -in ms.cer -out ms.pem openssl pkcs12 -inkey ms.key -in ms.pem -export -out ms.p12 

rigor789 commented 3 years ago

I originally tried with those, and it silently failed because of something Apple changed recently - which prompted me to figure out the ones I ended up using.

mskourtelis commented 3 years ago

i am on my way to check this asap

theremon commented 3 years ago

Apple changing things all the time and thus breaking the pipeline, is indeed an issue... The whole certificates issuing and setup procedure is quite difficult to follow, even without them changing things all the time. I wish that the plugin could have some customization option that would make it easier to adapt to Apple's changes... You done a great job @rigor789 and it's a shame that it appears broken...

mskourtelis commented 3 years ago

@rigor789 what about MATCH_PASSWORD ? Should i have to remove it or add an empty value "" ?

rigor789 commented 3 years ago

@theremon I would love to iterate and improve on this at some point, just frankly don't have the capacity/funding at the moment.

@mskourtelis MATCH_PASSWORD should be fine, it's only used to encrypt/decrypt your match repo, and is otherwise irrelevant to the certificates themselves. Just make sure you use the same one when importing the certs, as well as when running the build on circleCI.

mskourtelis commented 3 years ago

@rigor789 thank u very much !! I follow your guidelines and everything run smooth. Though i have one more last question. Production mode is same procedure ?

rigor789 commented 3 years ago

@mskourtelis awesome! Yes, I believe production certificates should be generated the same way - just select a Distribution type on the Apple side, and pass --release to the build command to build in Release/Production mode.