RN Android builds locally but Bitrise fails with "Could not find play-services-tasks-license.aar"

Description of the issue

After having successfully built our project many times, with no changes to the packages / gradle, all of a sudden our build gets stuck on react-native-push-notification when compiling our React Native Android project on Bitrise (but builds locally).

At first it was failing on the step: install-missing-android-tools

> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-push-notification'.
      > Could not find play-services-tasks-license.aar (com.google.android.gms:play-services-tasks-license:11.8.0).
        Searched in the following locations:
            https://jcenter.bintray.com/com/google/android/gms/play-services-tasks-license/11.8.0/play-services-tasks-license-11.8.0.aar

But I switched to using ā€œAndroid SDK Updateā€ in this step and that same error above started to show up in the ā€œ./gradlew assembleReleaseā€ step.

I have read a bunch of suggestions online to specify the play services 11.8.0. I even wrote a script to manually replace the node_modules build.gradle line for play services from version ā€œ+ā€ to ā€œ11.8.0ā€

This is the closest I could find to the problem I am having and there is no answer as of writing this post:
https://stackoverflow.com/questions/52987790/could-not-find-play-services-tasks-license-aar-com-google-android-gmsplay-serv

I can successfully run both ā€œ./gradlew assembleReleaseā€ and the bitrise CLI tool with install-missing-android-tools on my local computer.

I would not be writing this post if I could reproduce the failure locally.

Environment:

Oct 28, 2018 (issue also reported about 4 days ago on Stack Overflow)

stack: react-native

platform with issue: Android

step: install-missing-android-tools (as well as the main android building step)

Reproducibility

  • rebuild does not help
  • we are not using caches as far as I know
  • happens every time on our build
  • upgrading does not help
  • noticed as of today Oct 28, 2018
  • all steps work locally

Local reproduction

unable to reproduce locally

Build log

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-push-notification'.
      > Could not find play-services-tasks-license.aar (com.google.android.gms:play-services-tasks-license:11.8.0).
        Searched in the following locations:
            https://jcenter.bintray.com/com/google/android/gms/play-services-tasks-license/11.8.0/play-services-tasks-license-11.8.0.aar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.489 secs
error: exit status 1
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | install-missing-android-tools (exit code: 1)                  | 90 sec   |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...bitrise-steplib/steps-install-missing-android-tools/issues |
| Source: ...://github.com/bitrise-steplib/steps-install-missing-android-tools |
+---+---------------------------------------------------------------+----------+

Hi @paul-hart, while we are discussing this issue on our on-site chat, to anyone might be reading this please check this thread for the solution: Install-missing-android-tools@2.1.1 Could not find intellij-core.jar

Any of that would make sense IF I could not build locally.

Can you explain what you mean here? Arenā€™t these dependencies already included on your local environment so you donā€™t have to download them to begin with?

Itā€™s true, I have the build tools and SDKs I need on my machine which is a factor.

But on Bitrise, I have tried to replace ā€˜install-missing-android-toolsā€™ with ā€˜Android SDK Updateā€™ where I specify all the SDKs and build tools needed. This did not fix the issue. I get the same exact react-native-push-notification failure but this time while ā€˜gradlew assembleReleaseā€™ is running.

I read all these support sites saying to change package versions. Add ā€˜google()ā€™ to build.gradle. Specify which version of google play you use in the NPM packages build.gradle.

But when it comes down to it, the only reason I am changing any version on any build.gradle is because it will not build on Bitrise. I AM able to build it using ā€˜./gradlew assembleReleaseā€™ in the android project. I could then just plop that APK on the Play Store manually and be done with this. But we would prefer to fix our CI ā€¦

Why would all these build.gradle / version numbers / using google() matter on your server but not our local developer machines? It almost seems like Bitrise does not support our version of gradle or something.

Hi again!

Weā€™ve discussed most of this on intercom, but allow me to reply here as well please,

The issue you are experiencing is completely out of our control. As far as we know this is something you would experience using any CI tool since it is put simply, the fact that the place your build will look for dependencies by default is not operational. Changing the order of entries in your build.gradle so that google() is the first matters because that means that instead, your build will look for the dependencies directly through google which is a lot more stable and has proven to be a solution to these issues. And again, this does not matter locally because:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.