Builds failing - not accepting license agreements

Checking the license for package Android SDK Build-Tools 25.0.2 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 25.0.2 not accepted.
FAILURE: Build failed with an exception.

  • What went wrong:

You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 25.0.2].

Our Android builds started failing 2 days ago. Whatā€™s wrong?

Most likely duplicate of Steps-install-missing-android-tools failing - 'You have not accepted the license agreements of the following SDK components:'

Did you try to upgrade the step?

If the step upgrade would not solve it, please include the whole log / build url! :blush:

Weā€™re not using the step upgrade component in our projects. These are the scripts weā€™re using:

#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x

rsync -avhP ./android-licenses/ "$ANDROID_HOME/licenses/"

and:

#!/bin/bash
./gradlew dependencies || true

Is there a way we can send you our build log directly? We do not want to post it publicly.

It seems that you have old license hash.
You can either update it (here are the current hashes: https://github.com/bitrise-steplib/steps-install-missing-android-tools/commit/7b4120f2f7ed72949f97c8a943ded9cbfc48f803#diff-7ddfb3e035b42cd70649cc33393fe32cR77) or accept all the licenses like that:

#!/bin/bash
yes | sdkmanager --licenses
1 Like

@koral 's right, or use our Install Missing Android Tools step, which does exactly this (installs these dependencies and accepts the license) :wink:

Not completely. Install Missing Android Tools step contains hardcoded license hashes. If Google changes license build will start to fail again until new version of the step is released and users update their workflows (if they are not using alwayst latest version).

OTOH sdkmanager --licenses will accept all the current licenses at the time of invocation, no need to update anything. The only edge case can occur if license is changed in the short time window between ā€œAccept licensesā€ and compilation (e.g. Gradle Runner) steps.

An update for the step is scheduled for next week to remove the hash based solution @koral :wink:

Tldr the complication was the LTS stack, which has older Android tools and no sdkmanager, so we rolled out a quickfix and scheduled a revision for next week :blush:

1 Like

We were able to resolve this problem by accepting all licenses as follows:

Thanks!

@koral Weā€™re getting this issue now and the build is failed. Weā€™re using node version 12.18 and running in Xcode 11.7.x, on macOS 10.15.6 (Catalina)

Failed to install licenses using $(sdkmanager --licenses) command
Continue using legacy license installationā€¦
Ensure required Android SDK components
Retryingā€¦
Failed to ensure android components, error: output: Configuration on demand is an incubating feature.

is the solution below valid still. If yes, where should i enter these values.

#!/bin/bash
yes | sdkmanager --licenses

Iā€™m new to bitrise. Can you pls advise as it is quite important to resolve at the earllest.

Itā€™s still valid.
You should enter it in a script step somewhere before your build step.

@koral
Thanks a lot for helping out. That license issue got fixed, but it throws the following error

Task :app:stripReleaseDebugSymbols FAILED
WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
Task :app:mergeDexRelease
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ā€˜:app:stripReleaseDebugSymbolsā€™

No version of NDK matched the requested version 21.0.6113669. Versions available locally: 21.4.7075529

Should i use android.ndkVersion in build.gradle? Is that the only problem here.

You can use install-missing-android-tools step. New version with NDK support fixed was just released Release 3.0.0 Ā· bitrise-steplib/steps-install-missing-android-tools Ā· GitHub

Hey!

I got this issue

Failed to set executable permission for gradlew, error: chmod : no such file or directory

It looks like you are passing an empty string as a gradlew path input value.

should be like this, right?
android/build.gradle

React Native Project

@koral
Iā€™m using install-missing-android-tools. Also if possible and do you know if the version 3.0.x install-missing-android-tools is compatible for react-native 61.5 version?

And secondly i suppose selecting the 3.0.x in install-missing-android-tools would automatically resolve the NDK version.

Please advise

By default it should be android/gradlew
not build.gradle
However, Iā€™m not 100% sure how does it work in case of RN this file may be generated by RN toolchain perhaps in a different location.

I donā€™t know.

It should. That was one of the goals of 3.x release I suppose.

we donā€™t have this folder /.gradlew in the Repo!

Maybe can @baranit help us how they set the gradlew path in his project!

It is gradlew present on your screen. Without the leading dot. There was a typo in my previous message. Just corrected it. Sorry for the confusion.

uh no problem, well, thx i will check it.

did you have faced this issue before?