Reputation: 1302
I uploaded a new project to Jenkins that has compileSdkVersion as 26 and targetSdkVersion 25. I have accepted all licenses for the sdk with the below command:
./sdkmanager --licenses
Everything runs all good on my PC, but when I build on Jenkins it throws below error:
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
Configuration 'testCompile' in project ':app' is deprecated. Use'testImplementation' instead.
Configuration 'provided' in project ':app' is deprecated. Use 'compileOnly' instead.
Checking the license for package Android SDK Build-Tools 26.0.2 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not
accepted.
Checking the license for package Android SDK Platform 26 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Platform 26 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 26, Android SDK Build-Tools 26.0.2].
I ran the same command to accept licenses on the Jenkins machine, and it said all the licenses have been accepted. I am not sure what is going wrong.
Can someone help?
Thanks
Upvotes: 0
Views: 5910
Reputation: 1302
I was able to solve this issue. The actual problem was that the local.properties file was missing which had the android sdk path
Upvotes: 3
Reputation: 9978
Probably you accepted the licenses for the SDK APIs but the Build Tools are in the second tab. Open it from Android Studio and make sure you cover all the tabs, not just the first one.
To find the SDK Manager from AS go to File, Settings, Appereance & Behavior, System Settings, Android SDK. Check the second tab that says SDK Tools.
Upvotes: 2