Can't compile Android : To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

#1

Hello,

I got the following error when building on Android :

Here is the stacktrace :

Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_a9uydmmhn77pqdiktyzizamyr.run(/app/workingdir/android/sdk31/android-shell-app/ReactAndroid/build.gradle:141)
	(Run with --stacktrace to get the full stack trace of this deprecation warning.)
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':ReactAndroid'.
[stderr] > Failed to notify project evaluation listener.
[stderr]    > Failed to install the following Android SDK packages as some licences have not been accepted.
[stderr]         platforms;android-27 Android SDK Platform 27
[stderr]         build-tools;27.0.3 Android SDK Build-Tools 27.0.3
[stderr]      To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
[stderr]      Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
[stderr]      
[stderr]      Using Android SDK: /usr/local/android-sdk-linux
[stderr]    > Failed to install the following Android SDK packages as some licences have not been accepted.
[stderr]         platforms;android-27 Android SDK Platform 27
[stderr]         build-tools;27.0.3 Android SDK Build-Tools 27.0.3
[stderr]      To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
[stderr]      Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
[stderr]      
[stderr]      Using Android SDK: /usr/local/android-sdk-linux
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 11s
Error: Process exited with non-zero code: 1
    at ChildProcess.child.on (/app/node_modules/@expo/spawn-async/build/spawnAsync.js:39:21)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)```

Any ideas ? Is the problem because of me or Expo servers ?
5 Likes
#2

I am getting the same. This is definitely an Expo error, as I have made no changes except change paddingTop style from 10 to 5.

3 Likes
#3

Same here. Does anyone have a solution?

:frowning:

1 Like
#4

I got the same error.

1 Like
#5

same for me. Maybe they are running maintenance?

#6

Hey. I had the same issue.
I solved it by (1) accepting the licenses** and (2) copying the ‘licenses’ folder into my sdk folder (as explained here: https://developer.android.com/studio/intro/update)

__
** Not sure whether it was actually a necessary step, but it was something I’d tried first

  1. Navigate to sdkmanager.
    ~/Library/Android/sdk/tools/bin
  2. run sdkmanager
    ./sdkmanager --licenses
3 Likes
#7

The same problem here, it just happened after i updated from 27 to 32. Anyone knows if lower version it works?

I tried again and it worked well, i did nothing.

#8

I’m seeing the same error also, but randomly my Android build does compile. It may be that the machine rendering our builds may not be updated with proper SDKs but some of them are. I’ve been able to get a few builds through, but took lots of attempts.

Just got another to go through after 4 failed attempts.

3 Likes
#9

Cool. This is working.

#10

As mistle say:

1.-Download the option you need from https://developer.android.com/studio/?hl=es-419
2.-Then, unzip the files and open a command window. (I put the extracted files in C :slight_smile:
In the command window go to the folder -> bin and execute:
sdkmanager --licenses
It takes a little, here only accept the licenses.

Thanks mistle

1 Like
#11

Thank you!

#12

I have the same problem. It seems to appear randomly, sometimes build succeeds but most of the time it fails with error about license.
I have no idea how can I accept licenses on build machine it seems to be impossible.

#13

We need quick fix we cannot upload our APK because of that. We believe expo team

1 Like
#14

Same issue, sometimes with 28, others with 27. Tried ten times.

#15

Still same issue tried over ten times

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ‘:app’.
[stderr] > Failed to install the following Android SDK packages as some licences have not been accepted.
[stderr] platforms;android-27 Android SDK Platform 27
[stderr] build-tools;28.0.3 Android SDK Build-Tools 28.0.3
[stderr] To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
[stderr] Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
[stderr]
[stderr] Using Android SDK: /usr/local/android-sdk-linux
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 13s
Error: Process exited with non-zero code: 1
at ChildProcess.child.on (/app/node_modules/@expo/spawn-async/build/spawnAsync.js:39:21)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

#16

It’s not working (again), keep getting the same issue, when trying to build APK.

#17

I don’t use Android Studio to build the apps. I use Visual Studio Code , so i execute “expo build:android” from the terminal.

I believe Expo team need to fix on the licenses issue on the build machine.

6 Likes
#18

Still not working

2 Likes
#19

tried this before, and nothing happened… the error still coming up when i try build the apk

2 Likes
#20

Same issue here. Accepting the licenses via the sdkmanager did nothing for me.

1 Like