Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Fails on first run, works on second #47

Open
cwc opened this issue Aug 21, 2014 · 8 comments
Open

Fails on first run, works on second #47

cwc opened this issue Aug 21, 2014 · 8 comments

Comments

@cwc
Copy link

cwc commented Aug 21, 2014

I get the output below on the first attempt to build in a clean CI environment. If I run the same command immediately afterward, it works fine. ANDROID_HOME is unset.

jenkins@vagrant-ubuntu-trusty-64:~/android-project-src$ ./gradlew clean build
Android SDK not found. Downloading...
SDK extracted at '/home/jenkins/.android-sdk'. Writing to local.properties.
Build tools 19.1.0 missing. Downloading...
Platform tools missing. Downloading...
Compilation API android-20 missing. Downloading...

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jenkins/android-project-src/TheProject/build.gradle' line: 49

* What went wrong:
A problem occurred evaluating project ':TheProject'.
> failed to find target android-20 : /home/jenkins/.android-sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 39.025 secs
@artem-zinnatullin
Copy link

I think it's okay, seems that Gradle trying to find dependencies before the
sdkmanager plugin downloads them, so it will fail the build even if
sdkmanager plugin will get required dependencies.

I faced same problem, when I wanted to change appVersion in one of my
gradle tasks, but it was initialized by gradle before running any task..
22 авг. 2014 г. 3:55 пользователь "Cameron Currie" notifications@github.com
написал:

I get the output below on the first attempt to build in a clean CI
environment. If I run the same command immediately afterward, it works
fine. ANDROID_HOME is unset.

jenkins@vagrant-ubuntu-trusty-64:~/android-project-src$ ./gradlew clean build
Android SDK not found. Downloading...
SDK extracted at '/home/jenkins/.android-sdk'. Writing to local.properties.
Build tools 19.1.0 missing. Downloading...
Platform tools missing. Downloading...
Compilation API android-20 missing. Downloading...

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/jenkins/android-project-src/TheProject/build.gradle' line: 49

  • What went wrong:
    A problem occurred evaluating project ':TheProject'.

    failed to find target android-20 : /home/jenkins/.android-sdk

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 39.025 secs


Reply to this email directly or view it on GitHub
#47.

@daj
Copy link

daj commented Jan 7, 2015

Does anybody know a workaround for this issue? It causes my CI a lot of pain. I think this hits me whenever my cloud based Jenkins provider (CloudBees) creates new slave images.

@calren
Copy link

calren commented Jan 28, 2015

Sam as @daj , I'm seeing this problem and don't know how to resolve it for CI purposes. Any pointers?

@daj
Copy link

daj commented Feb 28, 2015

I posted a workaround that you can use if you hit this issue:
http://stackoverflow.com/a/28777153/112705

@rohans310
Copy link

Hi @calren Did you find a workaround? I'm facing this issue on Jenkins.

@calren
Copy link

calren commented Apr 16, 2015

@rohans310 try using https://github.com/JakeWharton/sdk-manager-plugin, it solved my problem

@rohans310
Copy link

@calren I am using this plugin. I get this error -

Build tools 22.0.0 missing. Downloading...
Compilation API android-22 missing. Downloading...
Support library repository missing. Downloading...
Google Play Services repository missing. Downloading...
Package resolve took 10253 ms.

FAILURE: Build failed with an exception.

What went wrong: A problem occurred configuring project ':app'. failed to find target android-22 : /usr/local/android-sdk

Seems like it is downloading the dependencies, but still giving me this error. any ideas?

@ghost
Copy link

ghost commented Mar 16, 2016

For a few days, I encountered some problems with sdk-manager-plugin on my Jenkins CI.

sdk-manager-plugin failed on ~/.android-sdk directory and sub dirs in Jenkins home. I obviously checked the user rights and the jenkins user execution context. No problem from this part. No problem on my workstation too.

Any idea about this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants