Ionic package build android fails license platform 26 not accepted

I’ve tried many times on a Win 10 notebook and a MacBook Pro and always get the same error:
BILD FAILED … "You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. I went to …Android\sdk\tools\bin to run sdkmanager --licenses, accepted all licences and tried package again. Same error. sdkmanager --licenses says “All SDK package licenses accepted”. I uninstalled SDK Platform 26 and re-installed it. ran sdkmanager --licenses again. Same result. Ran ionic package build android --profile xxx --release --prod again. Same failure. What else can be done?
Thanks for your help!

Ionic Package is a hosted service. You should use this: http://ionicframework.com/support#support

What is your ionic info output?

Thanks Jan, your link sent me to the same URL :).
ionic info says:

cli packages: (C:\Users\LENOVO\Documents\acad\Old\taxoil\node_modules)

    @ionic/cli-utils  : 1.13.0
    ionic (Ionic CLI) : 3.13.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 2.0.2
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.5.3

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.1
    npm               : 3.10.10
    OS                : Windows 10

Misc:

    backend : legacy

Old, you should update this.

Updated to 3.0.1. Unfortunately, the problem persists.

@swissfritz very strange really, never happened to me neither on win 7, mac os sierra or debian 9. Try to duplicate project and give autoritiy to each os maybe?

François

Thanks Francois, I duplicated project to my OS Sierra notebook and the same thing happened as with Win 10. And it never happened to me before either :(.

I tried to package a simpler project that showed BUILD SUCCESS as the former project did and the package info showed FAILED with the same error as before.
The licenses on the win 10 machine are under

C:\Users\LENOVO\AppData\Local\Android\sdk\licenses

The code in the android-sdk-license is

8933bad161af4178b1185d1a37fbf41ea5269c55
d56f5187479451eabf01fb78af6dfcb131a6481e
1 Like

On the MacBook mit OS Sierra, the licenses are under ~/Library/Android/sdk/licenses.

I repeat myself:

This means it doesn’t matter much what you do on your machine as the build is done on a cloud machine. If something on that machine doesn’t work as expected, there is nothing a local change to the licences can fix. You have to contact support about this.

Create a new project with ionic start and try to build it. Does it work?

Well, we should flood them with support claims. Ionic seems to introduce links in config.xml and package.json that refer to android “^6.2.3” while it can’t process this information. We have to manually remove the “^”. in front of 6.2.3. This concerns us all! All of us who want to package projects for android and have installed tens of new versions of ionic are let down by this flaw. Incredible.

1 Like

Actually, the ^ is added by Cordova, which is used in the background. Ionic team already worked with Cordova to get a function in that does not add the ^.

You might also want to check your attitude. You are using Open Source software, so the correct response for something like that is to create an issue that addresses this in an appropriate way - and best a pull request that fixes the problem.

I’m sorry Jan, of course you are right. Again: I’m sorry, I lost it!

1 Like

Thx, the solution solved me.
I have rebuild the Project and SDK several times, only your solution work.
Thank you so much !!

1 Like

Thanks evanlam, the glory is due to the ionic team. As Jan suggested, I should have opened a ticket with the Ionic team immediately for when I inserted the title of my problem, I immediately got a hint as to the causeand that also solved it.

1 Like

Just to clarify, the “fix” for this issue is removing the ^ (caret symbol) in front of the version number for the cordova-android dependency in package.json and config.xml:

package.json

    "dependencies": {
        "@angular/common": "4.4.4",
        "@angular/compiler": "4.4.4",
         - - -
         - - -
        "cordova-android": "6.2.3",     <-------- remove the ^ from here
        - - -
        - - -
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.18"
    },

config.xml

    <engine name="android" spec="6.2.3" />     <-------- and here
1 Like