microsoft / app-store-vsts-extension

Visual Studio Team Services (VSTS) extension for performing continuous delivery to the App Store store from your automated CI builds
Other
95 stars 53 forks source link

[AppStoreRelease] Install specific Fastlane version doesn't work properly #245

Closed miketimofeev closed 3 years ago

miketimofeev commented 3 years ago

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/microsoft/app-store-vsts-extension/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: AppStoreRelease

list here (V# not needed):
https://github.com/microsoft/app-store-vsts-extension/tree/master/Tasks

Environment

Issue Description

I've tried to install a specific Fastlane version to avoid this issue https://github.com/microsoft/app-store-vsts-extension/issues/244 using the following code:

  - task: AppStoreRelease@1
    displayName: 'Publish to the App Store TestFlight track'
    inputs:
      serviceEndpoint: '$(apikey_service_endpoint_name)'
      appIdentifier: '$(app_identifier_name)'
      ipaPath: '$(build.artifactstagingdirectory)/**/*.ipa'
      shouldSkipWaitingForProcessing: true
      shouldSkipSubmission: true
      installFastlane: true
      isTwoFactorAuth: true
      fastlaneArguments: "-p $(apple_app_id)"
      fastlaneToolsVersion: SpecificVersion
      fastlaneToolsSpecificVersion: 2.183.0

Strangely, the output shows successful 2.184.0 installation and as well successful 2.183.0 installation but the following steps still use version 2.184.0, not sure what went wrong image

Task logs

https://buildcanary.visualstudio.com/deeb2bf9-e13d-4e1b-acc1-bf9844b08d19/_apis/build/builds/1562871/logs/76

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

2021-05-24T11:33:57.7558720Z [command]/usr/local/opt/ruby@2.7/bin/gem uninstall fastlane -a -I
2021-05-24T11:33:59.3867750Z Removing bin-proxy
2021-05-24T11:33:59.3869260Z Removing fastlane
2021-05-24T11:33:59.3870330Z Successfully uninstalled fastlane-2.184.0
2021-05-24T11:33:59.3992650Z [command]/usr/local/opt/ruby@2.7/bin/gem install fastlane -v 2.183.0
2021-05-24T11:34:25.5487980Z Successfully installed fastlane-2.183.0
2021-05-24T11:34:25.5489360Z Parsing documentation for fastlane-2.183.0
2021-05-24T11:34:25.5490470Z Installing ri documentation for fastlane-2.183.0
2021-05-24T11:34:25.5491210Z Done installing documentation for fastlane after 22 seconds
2021-05-24T11:34:25.5491930Z 1 gem installed
blackchineykh commented 3 years ago

I tried with version 2.183.0 and it worked for me. It did seem to have issues with the uninstall step but somehow it still worked

021-05-25T03:40:31.6916560Z ##[section]Starting: Publish to the App Store TestFlight track
2021-05-25T03:40:31.6931200Z ==============================================================================
2021-05-25T03:40:31.6931660Z Task         : Apple App Store Release
2021-05-25T03:40:31.6932100Z Description  : Release an app to TestFlight or the Apple App Store
2021-05-25T03:40:31.6932510Z Version      : 1.186.0
2021-05-25T03:40:31.6932800Z Author       : Microsoft Corporation
2021-05-25T03:40:31.6934290Z Help         : [More Information](https://marketplace.visualstudio.com/items?itemName=ms-vsclient.app-store)
2021-05-25T03:40:31.6934850Z ==============================================================================
2021-05-25T03:40:31.8813490Z [command]/usr/local/opt/ruby@2.7/bin/gem uninstall fastlane -a -I
2021-05-25T03:40:32.0591480Z ERROR:  While executing gem ... (Errno::ENOENT)
2021-05-25T03:40:32.0593620Z     No such file or directory @ rb_check_realpath_internal - /Users/runner/.gem-cache
2021-05-25T03:40:32.0710470Z ##[warning]There were errors when trying to uninstall fastlane. Review the error and if required add a script to your pipeline to cleanly uninstall fastlane prior to running this task. Uninstall error: Error: The process '/usr/local/opt/ruby@2.7/bin/gem' failed with exit code 1
2021-05-25T03:40:32.0732510Z [command]/usr/local/opt/ruby@2.7/bin/gem install fastlane -v 2.183.0
2021-05-25T03:40:58.9523670Z Successfully installed fastlane-2.183.0
2021-05-25T03:40:58.9524620Z Parsing documentation for fastlane-2.183.0
2021-05-25T03:40:58.9525470Z Installing ri documentation for fastlane-2.183.0
2021-05-25T03:40:58.9525980Z Done installing documentation for fastlane after 22 seconds
2021-05-25T03:40:58.9526360Z 1 gem installed
2021-05-25T03:40:58.9851870Z [command]/usr/local/lib/ruby/gems/2.7.0/bin/fastlane pilot upload --api_key_path /Users/runner/work/_temp/api_key***.json -i /Users/runner/work/r1/a/xxxxxx/ios/ios/build/xxxxxx.ipa -a com.xxxxxxxx --skip_waiting_for_build_processing true -p xxxxxxxx
2021-05-25T03:41:01.3999110Z [03:41:01]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
2021-05-25T03:41:06.6690490Z [03:41:06]: Sending anonymous analytics information
2021-05-25T03:41:06.6791430Z [03:41:06]: Learn more at https://docs.fastlane.tools/#metrics
2021-05-25T03:41:06.6892560Z [03:41:06]: No personal or sensitive data is sent.
2021-05-25T03:41:06.6910880Z [03:41:06]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
2021-05-25T03:41:06.6911810Z [03:41:06]: Ready to upload new build to TestFlight (App: xxxxxxxx)...
2021-05-25T03:41:07.4408140Z [03:41:07]: Going to upload updated app to App Store Connect
2021-05-25T03:41:07.4504350Z [03:41:07]: This might take a few minutes. Please don't interrupt the script.
.... continued to successful publish to TestFlight
miketimofeev commented 3 years ago

Uh, I've found the root cause — IpaResign@1 task installs the latest Fastlane and it's used by default no matter what we specified in the AppStoreRelease task

miketimofeev commented 3 years ago

@anatolybolshakov is it possible to improve IpaResign and let the user choose whether he needs a new Fastlane version or not? The same as in AppStoreRelease task Upd: nevermind. found it 😅 The issue is resolved now.

iooovolts commented 3 years ago

Is this working for everyone now? I am using version 2.183.0 with API key auth and I still get the missing username error. I have tried 2.183.2 and still no luck. Any ideas?

anatolybolshakov commented 3 years ago

Hi @iooovolts do you see the issue with IpaResign task?

iooovolts commented 3 years ago

Hi @iooovolts do you see the issue with IpaResign task?

Clearing the App Specific ID seems to make t work!