1

enter image description hereenter image description hereenter image description hereA release pipeline for xamarin.android is failing. There is one task in this release:

Publish to Google Play store

  • I have added JSON file from the developer play console
  • APK file path from Artifacts.
  • and given the package name.

Its failing with following message:

2020-06-26T14:40:02.8690362Z ##[error]System.Management.Automation.RemoteException: Traceback (most recent call last): 2020-06-26T14:40:02.8692807Z ##[error]System.Management.Automation.RemoteException: File "D:\a_tasks\publishPlaystore_20810fda-9c24-482a-a00c-6fcc16b30fd0\1.0.1\upload_apks_with_listing.py", line 27, in 2020-06-26T14:40:02.8693469Z from oauth2client import tools 2020-06-26T14:40:02.8693671Z ModuleNotFoundError: No module named 'oauth2client'

Full logs are here:

2020-06-26T14:39:15.5941331Z ==============================================================================
2020-06-26T14:39:15.5941643Z Task         : Publish to Google Play Store
2020-06-26T14:39:15.5941916Z Description  : Publish your APK to Google Play Store (Alpha, Beta, Production or Rollout)
2020-06-26T14:39:15.5942148Z Version      : 1.0.1
2020-06-26T14:39:15.5942322Z Author       : Alexandre Chohfi
2020-06-26T14:39:15.5943117Z Help         : [More Information](https://github.com/azchohfi/vsts-task-publish-playstore)
2020-06-26T14:39:15.5943433Z ==============================================================================
2020-06-26T14:39:15.6000016Z ##[warning]Task 'publishPlaystore' (1.0.1) is using deprecated task execution handler. The task should use the supported task-lib: https://aka.ms/tasklib
2020-06-26T14:39:15.6009131Z Preparing task execution handler.
2020-06-26T14:39:32.5231135Z Executing the powershell script: D:\a\_tasks\publishPlaystore_20810fda-9c24-482a-a00c-6fcc16b30fd0\1.0.1\publish.ps1
2020-06-26T14:39:32.8402613Z com.healthbit.app
2020-06-26T14:39:32.8407837Z D:\a\r1\a/_Healthbit Master-Xamarin.Android-CI/drop/com.healthbit.app.apk
2020-06-26T14:39:33.3275969Z Python 3.7.7
2020-06-26T14:39:33.3276966Z C:\hostedtoolcache\windows\Python\3.7.7\x64\python.exe
2020-06-26T14:39:33.3277344Z C:\hostedtoolcache\windows\Python\3.7.7\x64\scripts\pip.exe
2020-06-26T14:39:42.4806332Z Collecting pip
2020-06-26T14:39:42.5276657Z   Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
2020-06-26T14:39:43.1169997Z Collecting wheel
2020-06-26T14:39:43.1231804Z   Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
2020-06-26T14:39:43.1986490Z Installing collected packages: pip, wheel
2020-06-26T14:39:43.1986964Z   Attempting uninstall: pip
2020-06-26T14:39:43.1993275Z     Found existing installation: pip 20.1.1
2020-06-26T14:39:46.2729697Z     Uninstalling pip-20.1.1:
2020-06-26T14:39:46.2925429Z       Successfully uninstalled pip-20.1.1
2020-06-26T14:39:49.9060249Z Successfully installed pip-20.1.1 wheel-0.34.2
2020-06-26T14:39:50.6454675Z Collecting google-api-python-client
2020-06-26T14:39:50.6739591Z   Downloading google_api_python_client-1.9.3-py3-none-any.whl (59 kB)
2020-06-26T14:39:50.7797649Z Collecting google-auth-httplib2>=0.0.3
2020-06-26T14:39:50.7860607Z   Downloading google_auth_httplib2-0.0.3-py2.py3-none-any.whl (6.3 kB)
2020-06-26T14:39:50.9207074Z Collecting google-auth>=1.16.0
2020-06-26T14:39:50.9295217Z   Downloading google_auth-1.18.0-py2.py3-none-any.whl (90 kB)
2020-06-26T14:39:51.0565346Z Collecting six<2dev,>=1.6.1
2020-06-26T14:39:51.0679431Z   Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
2020-06-26T14:39:51.1535589Z Collecting uritemplate<4dev,>=3.0.0
2020-06-26T14:39:51.1595257Z   Downloading uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
2020-06-26T14:39:51.2806441Z Collecting google-api-core<2dev,>=1.18.0
2020-06-26T14:39:51.2900495Z   Downloading google_api_core-1.21.0-py2.py3-none-any.whl (90 kB)
2020-06-26T14:39:51.4234837Z Collecting httplib2<1dev,>=0.9.2
2020-06-26T14:39:51.4322339Z   Downloading httplib2-0.18.1-py3-none-any.whl (95 kB)
2020-06-26T14:39:51.5281857Z Collecting cachetools<5.0,>=2.0.0
2020-06-26T14:39:51.5358573Z   Downloading cachetools-4.1.0-py3-none-any.whl (10 kB)
2020-06-26T14:39:51.6647838Z Collecting rsa<5,>=3.1.4; python_version >= "3"
2020-06-26T14:39:51.6721504Z   Downloading rsa-4.6-py3-none-any.whl (47 kB)
2020-06-26T14:39:51.7388718Z Requirement already satisfied, skipping upgrade: setuptools>=40.3.0 in c:\hostedtoolcache\windows\python\3.7.7\x64\lib\site-packages (from google-auth>=1.16.0->google-api-python-client) (41.2.0)
2020-06-26T14:39:51.8327957Z Collecting pyasn1-modules>=0.2.1
2020-06-26T14:39:51.8392193Z   Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
2020-06-26T14:39:52.0387337Z Collecting requests<3.0.0dev,>=2.18.0
2020-06-26T14:39:52.0467660Z   Downloading requests-2.24.0-py2.py3-none-any.whl (61 kB)
2020-06-26T14:39:52.1511827Z Collecting googleapis-common-protos<2.0dev,>=1.6.0
2020-06-26T14:39:52.1590625Z   Downloading googleapis_common_protos-1.52.0-py2.py3-none-any.whl (100 kB)
2020-06-26T14:39:52.3786714Z Collecting protobuf>=3.12.0
2020-06-26T14:39:52.3881114Z   Downloading protobuf-3.12.2-cp37-cp37m-win_amd64.whl (1.0 MB)
2020-06-26T14:39:52.7079539Z Collecting pytz
2020-06-26T14:39:52.7150406Z   Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
2020-06-26T14:39:53.4366923Z Collecting pyasn1>=0.1.3
2020-06-26T14:39:53.4460062Z   Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
2020-06-26T14:39:53.5813789Z Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
2020-06-26T14:39:53.5879323Z   Downloading urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
2020-06-26T14:39:53.7408810Z Collecting chardet<4,>=3.0.2
2020-06-26T14:39:53.7481648Z   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
2020-06-26T14:39:53.8918463Z Collecting certifi>=2017.4.17
2020-06-26T14:39:53.8978979Z   Downloading certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
2020-06-26T14:39:53.9964691Z Collecting idna<3,>=2.5
2020-06-26T14:39:54.0035221Z   Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
2020-06-26T14:39:54.1249759Z Installing collected packages: cachetools, pyasn1, rsa, pyasn1-modules, six, google-auth, httplib2, google-auth-httplib2, uritemplate, urllib3, chardet, certifi, idna, requests, protobuf, googleapis-common-protos, pytz, google-api-core, google-api-python-client
2020-06-26T14:40:01.9193298Z Successfully installed cachetools-4.1.0 certifi-2020.6.20 chardet-3.0.4 google-api-core-1.21.0 google-api-python-client-1.9.3 google-auth-1.18.0 google-auth-httplib2-0.0.3 googleapis-common-protos-1.52.0 httplib2-0.18.1 idna-2.9 protobuf-3.12.2 pyasn1-0.4.8 pyasn1-modules-0.2.8 pytz-2020.1 requests-2.24.0 rsa-4.6 six-1.15.0 uritemplate-3.0.1 urllib3-1.25.9
2020-06-26T14:40:02.8690362Z ##[error]System.Management.Automation.RemoteException: Traceback (most recent call last):
2020-06-26T14:40:02.8692807Z ##[error]System.Management.Automation.RemoteException:   File "D:\a\_tasks\publishPlaystore_20810fda-9c24-482a-a00c-6fcc16b30fd0\1.0.1\upload_apks_with_listing.py", line 27, in <module>
2020-06-26T14:40:02.8693469Z     from oauth2client import tools
2020-06-26T14:40:02.8693671Z ModuleNotFoundError: No module named 'oauth2client'
2020-06-26T14:40:02.8693816Z 
2020-06-26T14:40:02.9026231Z ##[error]PowerShell script completed with 2 errors.
2020-06-26T14:40:02.9035336Z ##[section]Finishing: Publish  to Google Play Store
Queue li
  • 64
  • 5

1 Answers1

0

From the error log, the ModuleNotFoundError: No module named 'oauth2client'seems to be the root cause of this issue.

The oauth2client module is missing.

To solve this issue, you could add a Command Line task before the Publish to Google Play Store task.

Then you could run the script to install it.

steps:
- script: 'pip install -t {path}  google-api-python-client oauth2client'

This is the ticket I referenced

Hope this helps.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • I have tried right before publish task. It didn't work. Same Error. – Queue li Jun 29 '20 at 08:07
  • I have updated the question with some images showing my task details: 1- Agent Info 2- Command line task 3- Publish task – Queue li Jun 29 '20 at 08:23
  • Thanks for sharing the information. I tested it again and noticed that the module is installed in the path `/home/vsts/.local/bin`. To make it work, you may need to specify the path in the script. For example: `pip install -t {path} google-api-python-client oauth2client`. You may refer to this answer:https://stackoverflow.com/a/44011777/13464420 – Kevin Lu-MSFT Jun 29 '20 at 09:01
  • From the screenshot, it seems that you are using the `Google Play - Release` task. But the log is related with the `Publish to Google Play Store` task. Do these two tasks have the same issue? You could set the variable `system.debug = true` and check if there are more error message. – Kevin Lu-MSFT Jul 01 '20 at 10:05