expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
839 stars 85 forks source link

'eas build --platform ios' should allow selecting Team #1731

Closed valentynv closed 1 year ago

valentynv commented 1 year ago

We're developing and iOS app with Expo together with my partner. The app is registered with his Apple Developer account. I have full access to the app from my Apple Developer account. I have valid Distribution Cert and Provisioning Profile for the app. When building this app with eas build --profile development --platform ios --local I go through Apple login process. Here is what happens next:

✔ Valid code
✔ Logged in and verified
› Team Valentyn (xxx)
✔ Select a Provider › Dmytro (yyy)
✖ The bundle identifier react-native.8x3 is not available to team "Valentyn (Individual)" (xxx), change it in your app config and try again.
    UnexpectedAppleResponse: An attribute in the provided entity has invalid
    value - An App ID with Identifier 'react-native.8x3' is not available.
    Please enter a different string.

There was no option for me to select Team - CLI selected my own team instead Dmytro's. I tried to select both Dmytro and myself as Providers, to no avail. I assume that CLI should allow me to select a different team.

falola0021 commented 1 year ago

were you able to resolve this ?

valentynv commented 1 year ago

@falola0021 , unfortunately, no. At the moment, I need to ask my partner to build for me and send me builds whenever I need to make changes that require rebuilds.

EvanBacon commented 1 year ago

Please use the EXPO_APPLE_TEAM_ID environment variable to configure the team, eg https://github.com/expo/eas-cli/blob/95155681db4ed7666bf7b5a7c5f9873625ac9b17/packages/eas-cli/src/credentials/ios/appstore/__tests__/resolveCredentials-test.ts#L63

valentynv commented 1 year ago

Anyone was able to make it work with process.env.EXPO_APPLE_TEAM_ID? @EvanBacon , I have added process.env.EXPO_APPLE_TEAM_ID into app.config.js, but it didn't help, am I doing smth wrong? Also tried setting env variable in the OS, same problem. Cli version 3.8.0

dirk789 commented 1 year ago

@valentynv, having the same issue. Did you manage to solve this? Thanks!

ericgoe commented 1 year ago

I have the same issue. I figured out that when you delete your cookie, you are able to select your provider (not your team).

✔ Using remote iOS credentials (Expo server)

If you provide your Apple account credentials we will be able to generate all necessary build credentials and fully validate them.
This is optional, but without Apple account access you will need to provide all the missing values manually and we can only run minimal validation on them.
✔ Do you want to log in to your Apple account? … yes

› Log in to your Apple Developer account to continue
✔ Apple ID: … mail@mail.lu
› Restoring session /path/to/cookie

The cookie file is placed under the path you see after "Restoring session". I've deleted the file and reran the command. You are able to choose between your providers now.

However I still don't get my head around the difference between providers and teams in the apple developer world. I ran into the same issue @valentynv with the bundle id. As far as I understand, an apple account can only be associated to one team but you can be a provider of multiple organisations such as your own or other organisations. Can anybody confirm this? If this is true, it makes total sense then that we cannot select a different team in the prompt of eas build.

amorriscode commented 1 year ago

@EvanBacon I transferred my iOS app to a different App Store team and now I can't build it because of this. Is it actually possible to set the Apple Team ID for the build command?

andreiraduglavan commented 1 year ago

Having the same issue. Did anyone was able to find a workaround?

ConnorOnTheWeb commented 1 year ago

Transferred the app to someone else's Apple ID, need to update the app, and now Transporter won't deliver my builds. My build uses my own Team ID, but Transporter seems to want the Team ID of the new account.

Prompt

Asset validation failed (90159)
Invalid provisioning profile. This app contains an embedded provisioning profile that is not associated with your account. Please use a provisioning profile associated with Team ID XXXXXXXXXX. (ID: 8f54ad36-7882-4e66-9f9a-39a5302484aa)

Logs

2023-08-15 18:10:40.477  INFO: ContentDelivery version 2.14.8 (14038).
2023-08-15 18:10:40.485  INFO: Show Progress: Contacting Apple Services…
2023-08-15 18:10:40.934  INFO: Show Progress: Making copy of ‘application-67492070-818b-4338-9baa-77a534b7882b.ipa’…
2023-08-15 18:10:40.936  INFO: Show Progress: Preparing to upload ‘application-67492070-818b-4338-9baa-77a534b7882b.ipa’…
2023-08-15 18:10:41.034  INFO: Show Progress: Analyzing package…
2023-08-15 18:10:46.541  INFO: Show Progress: Sending analysis to App Store Connect…
2023-08-15 18:10:47.665  INFO: COMPLETED - PART 1
2023-08-15 18:10:47.671  INFO: Show Progress: Waiting for App Store Connect analysis response…
2023-08-15 18:10:55.426 ERROR: Asset validation failed (90159) Invalid provisioning profile. This app contains an embedded provisioning profile that is not associated with your account. Please use a provisioning profile associated with Team ID XXXXXXXXXX. (ID: 8f54ad36-7882-4e66-9f9a-39a5302484aa)
2023-08-15 18:10:55.716  INFO: Show Progress: Upload failed.
Asset validation failed
Invalid provisioning profile. This app contains an embedded provisioning profile that is not associated with your account. Please use a provisioning profile associated with Team ID XXXXXXXXXX. (ID: 8f54ad36-7882-4e66-9f9a-39a5302484aa)
2023-08-15 18:10:55.717  INFO: 
=============
UPLOAD FAILED with 1 error.
=============

Apple is "down for maintenance, check back later," so I'm building without logging in, then submitting the file with Transporter. If I could log in through EAS this might not be an issue. Otherwise, if I could modify the Team ID I'm thinking that would fix Transporter's issue right now.

eas.json has no effect, is there another way?

codergautam commented 1 year ago

After several hours this is what I found (thanks to GeyserJolt943 on Github)

Basically I was building a project for a non-technical client and needed to upload their app in their team. They added me as admin with sufficient permissions but it would not work.

It comes down to this:

Note: If you’re enrolled as an individual and add users in App Store Connect, users receive access only to your content in App Store Connect and are not considered part of your team in the Apple Developer Program.

My client had a individual account, not organization so that means you only get access to the app not the bundle IDs. This gave me the following error:

✖ The bundle identifier ai.barbosa.app is not available to team XXX, change it in your app config and try again.
An attribute in the provided entity has invalid value - An App ID with Identifier XXX is not available. Please enter a different string.

Hope this helps someone 👍

ConnorOnTheWeb commented 1 year ago

I'm not finding any documentation of where to change this in the app config, or how to solve it that way.

Current plan is to get the user to switch from 'individual' to 'organization' (which they say they already did, but that must have been more of a check box on the initial account creation), create a team, add app to team, add me to that team, then see if I can upload the bundle.

codergautam commented 1 year ago

It's a different type of developer account itself, see https://developer.apple.com/programs/enroll/

isaachinman commented 9 months ago

@EvanBacon Any up-to-date advice on how to configure team ID?

gajojr commented 8 months ago

@EvanBacon I also have this issue after transferring to the owner's team, he has regular apple account but he is able to build using eas:

But I get this error: The bundle identifier com.gajovac.falinamigrac is not available to team "Andrija Gajic (Individual)" (teamId), change it in your app config and try again. An attribute in the provided entity has an invalid value - An App ID with Identifier 'com.gajovac.falinamigrac' is not available. Please enter a different string. Error: build command failed.

Even though I chose new team and the owner was able to build with the same command `eas build --platform ios --local`
bradydowling commented 1 month ago

I'm having this issue when running expo prebuild --platform ios. Adding the EXPO_APPLE_TEAM_ID environment variable before the command doesn't seem to help at all. Is there a way to set the team for expo prebuild?

theohdv commented 1 month ago

@bradydowling we are using a plugin to do so

export const withAppleTeamID: ConfigPlugin = createRunOncePlugin((expoConfig) => {
  return withXcodeProject(expoConfig, (config) => {
    const buildConfig = config.modResults.hash.project.objects.XCBuildConfiguration;

    Object.keys(buildConfig).forEach((key) => {
      if (buildConfig[key]['buildSettings']) {
        buildConfig[key]['buildSettings']['DEVELOPMENT_TEAM'] = 'YOUR_APPLE_TEAM_ID';
      }
    });
    return config;
  });
}, 'withIOSCustomNativeConfig');
zacharytyhacz commented 1 month ago

If you are added as 'Admin' to an "Individual" 's account...

then you are not technically part of any team because you were added to an Individual's account.

I am also doing all this app store stuff on the behalf of a nontechnical client.

I am to test this out now to fix:

image