'Fastalane upload fails: An attribute value is not acceptable for the current resource state. - The attribute 'versionString' can not be modified

I am trying to push a new build to the appstore. But my fastlane build failed with this error message:

/Library/Ruby/Gems/2.6.0/gems/fastlane-2.204.3/spaceship/lib/spaceship/connect_api/api_client.rb:199:in `handle_response': [!] An attribute value is not acceptable for the current resource state. - The attribute 'versionString' can not be modified. - /data/attributes/versionString (Spaceship::UnexpectedResponse)

platform :ios do
  desc "Push a new release build to the App Store"
  lane :Runner do
  increment_build_number(xcodeproj: "Runner.xcodeproj")
  build_app(scheme: "Runner", silent: true)
  upload_to_app_store
  end
end


Solution 1:[1]

Turns out the problem was that that app isn't approved and released for the appstore yet. So I can only upload it to TestFlight.

I needed to use upload_to_testflight fastlane

So the whole script in the Fastfile looks like:

platform :ios do
  desc "Push a new release build to the App Store"
  lane :Runner do
  increment_build_number(xcodeproj: "Runner.xcodeproj")
  build_app(scheme: "Runner", silent: true)
  upload_to_testflight
  end
end

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tbi