fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.67k stars 5.72k forks source link

>Just to be clear - this is not fastlane's fault, Game Center and In-app Purchase will be automatically enabled even if you are to create new bundle id from xcode or at developer.apple.com. #21488

Open iOSNinja opened 1 year ago

iOSNinja commented 1 year ago
          >Just to be clear - this is not fastlane's fault, Game Center and In-app Purchase will be automatically enabled even if you are to create new bundle id from xcode or at developer.apple.com.

Originally posted by @Katsz in https://github.com/fastlane/fastlane/issues/17172#issuecomment-688139814

iOSNinja commented 1 year ago

Hello, I have some customer apps that were created a few (2-3) years ago with "game-center" not added both in Xcode capabilities and also in provisioning profile. All app stores builds got approved till now until recently their certs/profiles got expired and i had used fastlane match command to regenerate them(this i did it in last week or so). The new provisioning profiles i see got included with game-center capability ON automatically, even though i dont see it in xcode->capabilities section or in the entitlements file. I do not pass game-center on in match command. Below is my match command:

match(
    git_private_key:   sshKey,
    type:             'appstore',
    app_identifier:    bundleId,
    team_id:           teamId,
    git_branch:        teamId,
    readonly:          false,
    keychain_name:     keychainName,
    keychain_password: "temppassword",
    profile_name:      bundleId
  )

Is fastlane match still enabling game-center capability ON automatically in the provisioning profile?

I'm not able to submit my new app builds for review. It's throwing below errors:

Screen Shot 2023-08-25 at 10 29 47 AM

Screen Shot 2023-08-25 at 10 26 27 AM

And also, any idea if Apple is requiring it mandatory have game-center enabled for all apps(non-gaming apps) by default?

Any help is appreciated! @Katsz Thank you.

evschu commented 1 year ago

We are also experiencing this issue. It appears that game center is getting enabled by default.

Here is the error we see when we try to publish the app:

appStoreVersions with id 'XXXXXXX' is not in valid state. - This resource cannot be reviewed, please check associated errors to see why. Your build indicates game center is enabled. - Your build has com.apple.developer.game-center key but appStoreVersion is missing gameCenterConfigurations relationship.

Has it always been enabled, but only now Apple is checking?

I don't believe anything has changed on our end, so I assume it's either an Apple rule or a Fastlane change.

Katsz commented 1 year ago

Sup. Soon after #17172 game-center stopped being enabled by default, only in-apps left. While I personally don't have any problems with game-center becoming enabled when matching (it stays checked off as it should be) I would suggest you following:

kacianoghelere commented 1 year ago

My team was struggling against the same problem @iOSNinja reported for days, upgrading fastlane to the latest version like @Katsz suggested did the trick.

So, in our case, it was fastlane's fault.

owurman commented 1 year ago

Fastlane 2.214.0 does not fix this. Looking at the code, it doesn't look like "off"is actually an allowed value for game_center in enable_services for produce. ~The only thing I can think to do without a patch is to manually use the command line fastlane produce disable_services~

Even disable_services is broken because it doesn't accept "off" as an option. What does work is using Spaceship directly:

bundle_id = Spaceship::ConnectAPI::BundleId.find(app_identifier)
bundle_id.update_capability("GAME_CENTER", enabled: false, settings: [])
assembleMHN commented 1 year ago

Im also facing this issue and with more than 300 apps it would be nice to be able to use fastlane to turn it off :(

assembleMHN commented 1 year ago

Fastlane 2.214.0 does not fix this. Looking at the code, it doesn't look like "off"is actually an allowed value for game_center in enable_services for produce. ~The only thing I can think to do without a patch is to manually use the command line fastlane produce disable_services~

Even disable_services is broken because it doesn't accept "off" as an option. What does work is using Spaceship directly:

bundle_id = Spaceship::ConnectAPI::BundleId.find(app_identifier)
bundle_id.update_capability("GAME_CENTER", enabled: false, settings: [])

HI @owurman can you by any chance elaborate how you got this to work, i have tried everything but keep getting: "\e[31m[!] undefined method `update_capability' for nil:NilClass" no matter what i do. Im not very well familier with Spaceship, but i really need to get this working :)

Thanks

owurman commented 1 year ago

app_identifier should be your full qualified app identifier (com.assembleMHN.appname) I can't really help you debug your Fastlane setup. See what you're getting for bundle_id? If it's nil, you're doing something wrong.

assembleMHN commented 1 year ago

@owurman app identifier is complete, but thank you anyway appreciate the response.

demonguru18 commented 1 year ago

Fastlane 2.214.0 does not fix this. Looking at the code, it doesn't look like "off"is actually an allowed value for game_center in enable_services for produce. ~The only thing I can think to do without a patch is to manually use the command line fastlane produce disable_services~

Even disable_services is broken because it doesn't accept "off" as an option. What does work is using Spaceship directly:

bundle_id = Spaceship::ConnectAPI::BundleId.find(app_identifier)
bundle_id.update_capability("GAME_CENTER", enabled: false, settings: [])

HI @owurman where did you place this code in FastFile as I keep getting this error - cannot find get_bundle_id method nil Class

I have placed the code in FastFile under before_all lane

before_all do    
    unless ENV['CUSTOM_APPLE_ID'].to_s.strip.empty?
     bundle_id = Spaceship::ConnectAPI::BundleId.find(ENV['CUSTOM_APPLE_ID'])
     bundle_id.update_capability("GAME_CENTER", enabled: false, settings: [])
    end
end
owurman commented 1 year ago

Perhaps y'all need to first do:

apple_id = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
Spaceship::ConnectAPI.login(apple_id)

In my case I was running this code after produce which presumably handled that for me.

bartpowers commented 1 year ago

We had the same issue and only command we could get to work was

    desc 'Turn off game center'
    lane :turn_off_game_center do |options|
        system("fastlane produce disable_services --game-center --username #{options[:apple_id]} --app-identifier #{options[:bundle_id]} --team-nam #{options[:team_name]} --team-id #{options[:team_id]}")
    end

But this results in needing certs and provisioning profiles so need to regenerate those after running the above command