Header Ads Widget

Ticker

6/recent/ticker-posts

React Native: fix error: Failed to install the following Android SDK packages as some licences have not been accepted

 Sample error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
D:\VueNative\demo>react-native run-android
(node:10776) Warning: Accessing non-existent property 'padLevels' of module expo
rts inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat ap
p:installDebug)...
 
> Configure project :app
File C:\Users\Administrator\.android\repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Users\Admi
nistrator\AppData\Local\Android\Sdk\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\Users\Administrat
or\AppData\Local\Android\Sdk\licenses
Warning: License for package Android SDK Platform 28 not accepted.
 
FAILURE: Build failed with an exception.
 
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not
 been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to anot
 
  Using Android SDK: C:\Users\Administrator\AppData\Local\Android\Sdk
 
* Try:
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.
 
* Get more help at https://help.gradle.org
 
Deprecated Gradle features were used in this build, making it incompatible with
Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
d_line_warnings
 
BUILD FAILED in 2s
error Could not install the app on the device, read the error above for details.
 
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag
for more details.

In error message we see:

1
2
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28

Now we must install Android SDK Platform 28:

Step 1: In Android studio, go to menu File -> Settings

Step 2:

install Android SDK Platform 28 step 2

Step 3:

install Android SDK Platform 28 step 3

Clck OK

Step 4:

install Android SDK Platform 28 step 4

Click Accept then Next

Step 5:

install Android SDK Platform 28 step 5

Wait for some minutes then Click Finish

Publicar un comentario

0 Comentarios