How to approve a license the Android SDK Tool in Jenkins - android

When I build my project the following message:
A problem occurred configuring project ':app'.
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 24, Android SDK Build-Tools 24.0.1].
In the folder "android-sdk-windows" there is neither file nor folder licence.
In a similar question it is not clear where to execute the command
android update sdk --no-ui --filter build-tools-24.0.0,android-24,extra-android-m2repository

It mean you didn't install [Android SDK Platform 24, Android SDK Build-Tools 24.0.1].
use
android list sdk -e
find the sdk and install

Related

how to finalize generating a signed SDK

When trying to generate a signed SDK, I receive an error message:
" Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;29.0.2 Android SDK Build-Tools 29.0.2 To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. "
As instructed, I started the SDK Manager, but I do not find where I can accept the SDK license agreements or install missing components. I see that some components can be updated, but I fail to find how to do that.
My Android studio 4.1.2 runs under Windows 10 home 64bit. To be able to generate signed SDK, I chose Android 9.0 (Pie) API level 28
You need to accept the licences before building.
According to Android SDK documentation you can use the following command depending on the sdkmanager location: Docs on --licenses option seems to be missing though.
%ANDROID_HOME%/tools/bin/sdkmanager --licenses

SDK Manager some Licenses Have not been Accepted

I'm getting the following error while trying to run ./gradlew build
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
platforms;android-29 Android SDK Platform 29
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
But when I run ./sdkmanager --licenses I get:
Warning: File /var/jenkins_home/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates...
So kinda stupid mistake that I did, I was using the xmartlabs/jenkins-android image which according to its Dockerfile set ANDROID_HOME to /opt/android-sdk-linux. Which was also mentioned in the error, I didn't notice it. Anyways I ended up creating an android sdk in a separate directory, where the license were accepted and so kept getting the unaccepted license agreements' error.

Why does TFS say that I need to accept the licenses to make an android build?

I have Team Foundation Server 2018 Express installed on the same machine as my android studio. My project builds just fine in android studio. But when I try to build it from TFS, I get the error:
2018-06-27T18:07:46.5160178Z FAILURE: Build failed with an exception.
2018-06-27T18:07:46.5250007Z
2018-06-27T18:07:46.5319886Z * What went wrong:
2018-06-27T18:07:46.5374784Z A problem occurred configuring project ':androidhelper'.
2018-06-27T18:07:46.5374784Z > Failed to install the following Android SDK packages as some licences have not been accepted.
2018-06-27T18:07:46.5414710Z platforms;android-26 Android SDK Platform 26
2018-06-27T18:07:46.5444654Z build-tools;27.0.3 Android SDK Build-Tools 27.0.3
2018-06-27T18:07:46.5449640Z To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
2018-06-27T18:07:46.5464600Z Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
2018-06-27T18:07:46.5499548Z
2018-06-27T18:07:46.5514516Z Using Android SDK: C:\Users\CAA\AppData\Local\Android\sdk\platform-tools
After checking in the SDK-Manager of android studio, the packages are, as far as I can tell, all installed:
On other threads I've found that using
sdkmanager --licenses
from command line might solve this issue. But according to the output, everything is accepted:
How do I archive my TFS to build the android project?
Update:
Other things I've tried:
I've deleted the folders of the platform and build tools. In addition I've deleted the content of the licenses folder. After reinstalling everything with the sdkmanager.bat and calling the --licenses option, everything is as it was before.
I've used the sdkmanager UI in android studio to uninstall and install the buildtools and the platform.
installed VS community edition, because i've found cases here on stackoverflow, where that was the solution
ensured that the agent service is running with the my login data
removed the agent service, deleted it entirely and downloaded it fresh.
Try below items to narrow down the issue:
Run below command :
cd $ANDROID_HOME/tools/bin ./sdkmanager --update
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Remove and install again:
1, Remove the platforms\android-26 folder.
2, Run sdkmanager "platforms;android-26" in the android-sdk\bin
folder.
3, Press y to accept the license and wait until it's installed.
Do the same thing for build-tools;27.0.3 Android SDK Build-Tools 27.0.3
Uninstall and reinstall from SDK-Manager
1, Uninstall the SDK Platform 26 and Build-Tools 27.0.3 and reinstall them again in SDK-Manager
2, Run %ANDROID_HOME%/tools/bin/sdkmanager --licenses and accept all the licenses.
Deploy a new agent on a different machine and install the Android SDK
on it. Try it again.

Not able to run react native in windows

Not able to run react native in windows
Checking the license for package Android SDK Build-Tools 23.0.1 in
C:\Users\ASUS\AppData\Local\Android\Sdk\tools\licenses
Warning: License for package Android SDK Build-Tools 23.0.1 not accepted.
Checking the license for package Android SDK Platform 23 in
C:\Users\ASUS\AppData\Local\Android\Sdk\tools\licenses
Warning: License for package Android SDK Platform 23 not accepted.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 23, Android SDK Build-Tools 23.0.1].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
but i tried add licences forder to sdk path it didnt worked.i update the all of my skd platform and sdk tools.but still im getting this error.how can i fix this.
If you start the Android Studio IDE, it will prompt you to agree to the license agreement. Once you accept, this error should be resolved.
Uninstall the entire Android Studio and reinstall with the latest Android SDK platforms will probably do the trick. Also, please try using the > sdkmanager --licenses command.

failed to find Build Tools revision 21.1.1 - sdk up to date

I´m running a linux android sdk installation and my new project needs Build tools 21.1.1
Somehow, this build tools do not exist, eventhough my sdk is up to date, but in the build-tools folder there is now android-4.4W folder
android update sdk --no-ui
My sdk/build-tools folder
I´ve moved the content testwise to a 21.1.1 folder, but this isn´t recognized either.
Is this a bug?How to I get the right build tools?
What worked for me was:
android list sdk -a
Which showed me the following list:
1- Android SDK Tools, revision 24.0.2
2- Android SDK Platform-tools, revision 21
3- Android SDK Build-tools, revision 21.1.2
4- Android SDK Build-tools, revision 21.1.1
5- Android SDK Build-tools, revision 21.1
6- Android SDK Build-tools, revision 21.0.2
7- Android SDK Build-tools, revision 21.0.1
... and a great many more
Followed by the command:
android update sdk -a -u -t 3
The "3" in the command refers the the index listed in the output of the first command.
Solved it by using
android update sdk -u -a
where the a parameter installs all packages. Not the best solution to install everything, but it has at least installed the required build tools version
I was getting this error on my Jenkins too:
failed to find Build Tools revision 21.1.2
Instead of getting all Android SDK updates, I just needed to:
Get Build Tools revision 21.1.2
sudo android update sdk --no-ui --all --filter build-tools-21.1.2
Other commands I've used:
Help:
sudo android update sdk --help
Get list of available Android SDK updates:
sudo android list sdk --extended --all
I had the same issue, and i could fix it by launching Android SDK Manager in Android Studio and install the Build Tools by checking the option.
In the error window where it displayes message as failed to find build tools versions, it also gives the link to install the tools version. You can update using that.
If the above option is not available then another way is:
Open the sdk tools tab from sdk manager in android studio. Click on 'Launch StandAlone SDK Manager'. In the new widnow, you will be able to see all the revisions of build tools, api levels, system images. From there you can can select the tools revision which are missing and install.

Categories

Resources