I'm trying to run my Ionic 3 project on my Android device with ionic cordova run android --device --stacktrace
, but, I've the following output:
...
Checking the license for package Android SDK Platform 26 in C:\Android\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 root project 'android'.
You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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
Reading other questions, people suggested using the Android Studio SDK manager and installing the latest versions, because then I would be asked about the licenses and would have to accept them, so I installed Android 8.0 (Oreo) and Android API 27 which are the last available updates, however, at no time was I asked about any license and the error persisted. My device is connected to the PC (Windows 10) via the USB cable and the programmer mode is enabled along with USB debugging. What can I do to resolve this?
My SDK manager:
Update:
I already ran the command sdkmanager --licenses
in the C:\Android\sdk\tools\bin
and C:\Users\User\AppData\Local\Android\sdk\tools\bin
folders and all the missing licenses were accepted, but the error continues.
My cordova-android version in package.json
: "cordova-android": "~6.3.0"
and in config.xml
: <engine name="android" spec="~6.3.0" />
(already tried with 6.3.0
and 6.2.0
without success)
Following the error:
Checking the license for package Android SDK Platform 26 in C:\Android\android-sdk\licenses Warning: License for package Android SDK Platform 26 not accepted.
But I don't have the licenses folder in C:\Android\android-sdk
, just in C:\Android\sdk
. How I do for Ionic check for the folder where the licenses really are?
ionic info
:
cli packages: (C:\Users\User\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.0
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v6.11.2
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Android\android-sdk
Misc:
backend : pro
cordova-android
– The Blue Shirt Developer"cordova-android": "~6.3.0"
– Igor