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.
Related
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
I'm trying to set up an automated build for an Android app from Team Foundation Services, using Gradle. Almost everything is correctly set up, but the build fails each time because two modules that the app is dependent upon do not have their licenses agreed upon. This is what I'm getting as an error output:
Checking the license for package Android SDK Build-Tools 28.0.3 in
C:\Tools\AndroidSdk\licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
Warning: Failed to read or create install properties file.
Checking the license for package Android SDK Platform 28 in
C:\Tools\AndroidSdk\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
Warning: Failed to read or create install properties file.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following SDK components:
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
Install the missing components using the SDK manager in Android Studio.
I've already tried pretty much everything I found on StackOverflow or other places. I deleted all licenses from %ANDROID_HOME%/Licenses folder, installed them again and agreed the terms (with sdkmanager.bat --licenses command); I added a PowerShell script that copies each license file for each module from %ANDROID_HOME%/Licenses folder to the output folder; I reinstalled the whole SDK; I've made sure that the agent has permissions to edit and delete files in the working folders. I've also tried running the build directly from the build server (without a TFS agent) and it successfully built, which is also strange.
Am I missing another thing I can do?
We fixed the issue by running an "--update" command on the sdkmanager.bat file in the folder where we have the SDK installed. A few modules from the SDK got updated and the error went away.
It is possible to have the "--update" command as a script step in the build definition on TFS, so the error does not come back eventually when one of the modules will be updated.
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.
when I run the command on cmd "react-native run-android" it says -
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
-I did the following and give me a same error?
"C:\Android\android-sdk\tools\bin"
Open cmd
Type
sdkmanager.bat licenses
Accept all licenses with 'y'
Accepted
I am getting error one after one again n again. who the dumb developed this system
The easiest way is to open the android studio SDK tools and update the recent version. I also followed the way u did, it didn't work for me. I had to install the latest versions to run it :)
you need to download and accept license Build-Tools 23.0.1 by doing following things
Android\sdk\tools\bin>sdkmanager.bat "build-tools;23.0.1"
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.