android - Automatically accept all SDK licences -


since gradle android plugins 2.2-alpha4:

gradle attempt download missing sdk packages project depends on

which amazingly cool , know jakewharton project.

but, download sdk library need to: accept license agreements or gradle tells you:

you have not accepted license agreements of following sdk components: [android sdk build-tools 24, android sdk platform 24]. before building project, need accept license agreements , complete installation of missing components using android studio sdk manager. alternatively, learn how transfer license agreements 1 workstation another, go http://d.android.com/r/studio-ui/export-licenses.html

and problem because love install sdk dependencies while doing gradle build.

i looking solution automatically accept licenses. maybe gradle script ? have ideas ?

thanks!

[edit]

a solution execute:

android update sdk --no-ui --filter build-tools-24.0.0,android-24,extra-android-m2repository 

and install manually, gradle's new feature purpose it.

[edit 2]

a better solution use sdkmananger:

yes | sudo sdkmanager --licenses 

i have encountered alpha5 preview.

jake wharton pointed out me can use

mkdir -p "$android_sdk/licenses" echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$android_sdk/licenses/android-sdk-license" echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$android_sdk/licenses/android-sdk-preview-license" 

to recreate current $android_home/license folder on machine. have same result process outlined in link of error msg (http://tools.android.com/tech-docs/new-build-system/license).

the hashes sha1s of licence text, imagine periodically updated, code work long :)

and install manually, gradle's new feature purpose it.

i surprised @ first didnt work out of box, when had accepted licenses named components via android tool, pointed out me sdk manager inside creates /licenses folder.

i guess official tools not want skip step legal reasons.

rereading release notes states

sdk auto-download: gradle attempt download missing sdk packages project depends on.

which not mean work if have not installed android tools yet , have accepted latest license(s).

edit: saying that, still not work on test gubuntu box until link sdk as. ci works fine though - not sure difference is...


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -