[SOLVED] iOS standalone build failed


#1

Hi,

I’ve been searching the forum for this error but found no solution other than creating a topic and sending the build ID :slight_smile:

The error I got:

ensured certificate is valid
writing export-options.plist file...
created export-options.plist file
generating IPA...
[stderr] [09:48:46] 'ios:build-and-sign-ipa' errored after 21 s
[stderr] [09:48:46] Error: Process exited with non-zero code: 1
[stderr]     at ChildProcess.child.on (/usr/local/turtle-agent/tools-public/node_modules/@expo/spawn-async/build/spawnAsync.js:39:21)
[stderr]     at emitTwo (events.js:125:13)
[stderr]     at ChildProcess.emit (events.js:213:7)
[stderr]     at maybeClose (internal/child_process.js:927:16)
[stderr]     at Socket.stream.socket.on (internal/child_process.js:348:11)
[stderr]     at emitOne (events.js:115:13)
[stderr]     at Socket.emit (events.js:210:7)
[stderr]     at Pipe._handle.close [as _onclose] (net.js:545:12)
unable to build and sign IPA

Build ID is: 9d12589c-8de9-46ce-b6e2-34994c50fa42

Can you please check what’s the underlying problem, as I tried to remove all certificates, provisioning profiles and push certs from developer.apple.com. Then tried to let expo handle all certificates and tried to upload my certs manually. Got the same error as above.

Thank you!


#2

hi @ksgy, we arent really sure what the root cause is, but we are currently looking into it. Could you let us know the steps you took to get this error?

Sorry for the inconvenience, wish i had a better answer for you.


#3

Hi @quinlanj

I built this app many times before for ios and android as well.
I remove all the provisioning profiles & certificates for that specific bundle, then I run these:

$ exp publish
$ exp build:ios -c

If I just exp publish the app, it’s fine, runs in Expo without any problems. But once I try to build it as a standalone app, it fails with the error above. Had issues before, but removing provisioning profiles & certs solved the problem.

Hope this helps, let me know if you need anything else that might help :slight_smile:


#4

i same


#5

Hi folks! We’ve just rolled out some changes that will hopefully report more helpful errors upon build failures. If you run it again and get a different output, it’ll either help you, or let us know here what it is if you need help. Please include the build id if so :slight_smile:


#6

Hi @schazers
Tried to rebuild app again, but sadly got the same error as before:

generating IPA...
[stderr] [01:44:06] 'ios:build-and-sign-ipa' errored after 20 s
[stderr] [01:44:06] Error: Process exited with non-zero code: 1
[stderr]     at ChildProcess.child.on (/usr/local/turtle-agent/tools-public/node_modules/@expo/spawn-async/build/spawnAsync.js:39:21)
[stderr]     at emitTwo (events.js:125:13)
[stderr]     at ChildProcess.emit (events.js:213:7)
[stderr]     at maybeClose (internal/child_process.js:927:16)
[stderr]     at Socket.stream.socket.on (internal/child_process.js:348:11)
[stderr]     at emitOne (events.js:115:13)
[stderr]     at Socket.emit (events.js:210:7)
[stderr]     at Pipe._handle.close [as _onclose] (net.js:545:12)
unable to build and sign IPA

Build ID: fe08f169-1c98-4290-9db3-1e09d6a3221c


#7

@ksgy
Actually we deployed the right change just now. Previously, we only thought we deployed it. Sorry for that. Could you try running build again and posting build id again? Thanks!


#8

@ksgy
We have more build logs which we intentionally don’t show to users. It looks like you have wrong provisioning profile uploaded to our servers. It appears to be associated with different distribution certificate than the one we have.

Could you please do following steps?

  1. Run exp fetch:ios:certs in your project dir. This command will create a .mobileprovision file in the same dir.
  2. Go to https://developer.apple.com/account/ios/profile/ page, find and download a provisioning profile associated with the distrubtion cert you use for this app (it’s should also be in your project’s dir in appname_dist.p12 file). You can check which dist cert is selected after selecting a profile in the list and clicking “Edit” button.
  3. Using diff command or by creating md5 sum compare 2 provisioning profiles.
  4. If they are different, you have to upload the right one to our servers. You can use exp build:ios --clear-credentials and input paths to dist cert/push cert/provisioning profile on your own (fetched in 1. but with different provisioning profile). Alternatively, you can do exp build:ios --clear-credentials --revoke-apple-dist-certs --revoke-apple-push-certs --revoke-apple-provisioning-profile which will clear credentials from our servers and also from apple developer service and then let expo handle the process of generating crdentials.
  5. If they are not different, please let me know and i’ll continue investigation.

Thanks!


Unable to build ios - exit process code 1
#9

@dsokal
Thank you, seems like the problem was having multiple iOS Distribution certificates on Apple Developer Portal. Removed all provisioning profiles and certificates, including iOS Distribution, then ran the command above to clear credentials from server and the build succeeded! :slight_smile:

Just a quick question: how expo decides which iOS Distribution to use when I’m uploading a .p12 file? Is it selecting the lastly created?

Since you can list all the provisioning profiles and certificates, would be helpful for the user to get a message that “You have multiple ios distribution certificates - which one would you like to use?” and user can match up the provisioning profiles with the proper certificate. :slight_smile:

Hope this helps with future errors :sunny:


#10

@ksgy
When you’re “letting Expo handle the process”, we don’t download any previously created distribution certificate from Apple Developer service. The reason is simple - when you download a certificate, you don’t get a corresponding private key and this would be useless.

Therefore, there are three ways/flows of providing expo with distribution certificate:

  • you can let expo handle the process
    • if at some point in time you already generated a distribution cert for other expo app (using same apple team) and it’s still on expo servers, you’re asked if you would like to reuse this cert (you’re getting a list of dist certs with app names)
    • if you never generated a distribution cert with exp, it’ll try to generate a new one in Apple Developer service
  • you can upload a distribution cert (.p12 file) which you have locally

Let me know if it makes sense and if it’s the thing you asked about/proposed a solution for.


#11

@dsokal
Yeah, make sense now, thanks for the reply!

Last time I tried (was about 3 months ago) “Let expo handle the process” always wanted to create a new Distribution Cert, provisioning profile and push cert. That’s why I started to stick to upload my own .p12 file to avoid creating many Distribution Cert and then get confused which one is which (we’re releasing and updating many apps, based on the same project, so it was the best way to keep things in control)

I’ll give “Let expo handle process” a go and let you know if I had any problems. :slight_smile:


#12

Just for future reference:

We ended up using the same p12 file, manually uploading and letting Expo handle the push certificates, so we don’t have to worry about those. To store the keys and provisioning profiles, we’re using fastlane match

Hope this help others :slight_smile:


closed #13

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.