ChatGPT解决这个技术问题 Extra ChatGPT

Xcode export/upload error: Your session has expired. Please log in

I am trying to release an app from Xcode but as soon as I try uploading to the app store or exporting in any fashion, once it checks for signing from iTunes Connect, I receive the error

Your session has expired. Please log in.

I have made sure that I can log into my account on iTunes Connect and the signing certificates and provisioning profiles are current from the developer center.

I came across a similar issue last week: Xcode 6.4 Export Adhoc "Session has expired" but this issue seems different. I am using Xcode 7.1 this time, so the crash that I was observing last week may indicate the problem is different.


n
n8yn8

The session of one of my accounts (not even the one I was trying to use) had its session expired. This seems to be new. I just had to re-sign in to the errant account in Xcode > Preferences > Accounts.


if re-sign on the account you need to use don't resolve the problem, remove all the other account (just add it later). This worked for me.
+[comma] is shortcut for preferences
same error when resign +1... (this starts bothers me 1 day ago)
In my case it also said "Underlying error code 1100". I had to remove the only account, add it again and restart Xcode. Re-sign itself didn't work for me.
@YuyangHe, unfortunately Apple is a mystery machine when it comes to it's accounts. My problem stemmed from having multiple accounts and that version of Xcode wasn't good at checking the right account, so I had to fix the accounts that had expired sessions. Why those sessions expired, I don't know. That is under Apple's control.
s
shim

I had the same problem.

Solution: Go to Xcode->Preferences->Accounts and make sure that ALL your accounts are connected. If you have several accounts and only 1 of them is not connected you will always get the error, no matter for which account you want to do stuff/export/etc. So make sure ALL accounts are connected without exception. You see a lightning icon next to your accounts that are not connected.

Hope it helps other ppl :-)


That was really it. Thanks a lot :)
“ Go to XCode->Preferences->Accounts ” — That's not really a good option if you want reliable and unattended builds. Is there no way to make sure it works all the time
H
Hiran Stephan

I had same problem,

Xcode say:Your session has expired. Please log in.

I solved it through below steps

Enable two step verification fixes this issue:

On Mac Open System Preference App, Go to iCloud -> Account Details -> Security Tab (middle) and at bottom "Set Up Two-Factor Authentication". Add your mobile number and click "get a verification code".

https://i.stack.imgur.com/j5NHG.png

https://i.stack.imgur.com/noqRp.png

Goto Xcode preference and sign in again with your apple id and enter code.


After trying to uninstall and install xcode for 3 times. found your solution and tried it. and it worked. What a shame. Apple making so much complications to just sign in into xcode. The process should be simpler and customer friendly. Anyways thanks for suggestion.
Same problem, this fixed it and there were some errors in icloud also while modifying the settings.
s
shim

In my case, the problem gone away when I've re-added my account in Xcode > Preferences > Accounts and both logged out/logged in in the Mac App Store. I was checking my sandbox user and right after that Xcode began to say my session is expired. Hope this will help to resolve your issue.


Hmm... is your app a Mac app? I'm working with iOS apps.
E
Elshad Karimov

For Xcode 11 and Big Sur, I got official email from Apple saying that "From your email I can tell that a possible reason for you seeing this error message is the fact you are on the live version of Xcode and the. Beta version of MacOS. What I would suggest doing is updating the the Xcode version so it will better communicate with the MacOS. Please see the below link for more information on Xcode 12 beta."


Confirming: once I updated to the beta version of Xcode (12, beta 6), I was able to log in to my account successfully. I also am on the Big Sur beta, yet was continuing to use Xcode 11.6. I was getting signing errors stating that I needed to login to my account again; however, "login expired" messages started appearing in Xcode->Preferences->Accounts, and I was unable to log into any of my developer accounts in Xcode. The messages pointed me to the developer status page, where no issues were displayed, and I was able to log into the accounts from Developer and Connect. Now it's fine.
K
KawaiKx

I had the same issue after changing the APPLE ID password.

Go to: xcode> preferences>account> sign in again


B
Benetz

I had the same problem. I noticed that i had no problem login in the site, but i was not able to view or modify the provisioning profile, for this reason "Contact Team Agent We recently updated the Apple Developer Enterprise Program License Agreement. Your team agent must review and agree to continue."

Once my team agent agreed i could export my ipa file.


The odd thing is the account that had its session expired didn't have any problems like a new agreement.
s
shim

I didn't find log out in Xcode -> Preferences. Just restart Xcode and it helped me.


Thanks, it helped me. After restarting XCode, instead of red-text button "Try in", "Unable to log in with account "MY_EMAIL_ADDRESS" appeared, and I just added my AppleID password.
“Just restart XCode” — That's not really a good option if you want reliable and unattended builds.
R
Ryan Williams

In my case, Apple were trying to force me to update my profile / password. Try signing into https://appleid.apple.com/account/manage first.

Discovered this while trying to enable Two-Factor Authentication so thanks to Hiran for his suggestion.


s
shim

In my case I had both Application Loader and Xcode opened, it seems both were using the account and thus even when I tried to re-add my account through Preferences->Account, it still displays the same error message.

Once I closed the application loader, Xcode was able to add the account.


M
Midhun Narayan

In the end, finally resolved by calling apple support and getting elevated to upper level tech, where eventually we discovered missing shared folder in /Users. Adding a shared folder resolved my issue. Here’s the steps to reproduce solution if it applies to you:

Finder > Go > Go to Folder

enter /Users :: Go

if no Shared folder, open Terminal to create one in /User

Enter commands in Terminal (must be logging in as user with admin access):

sudo mkdir -p /Users/Shared

sudo chmod 1777 /Users/Shared/

reboot and see if can now login

resource https://discussions.apple.com/thread/7275650?start=0&tstart=0