i wnt to set CI with travis-ci with my android project.
Those are my gradles:
top-level
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
flatDir{
dirs 'libs'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.1'
classpath 'org.robolectric:robolectric-gradle-plugin:0.12.0'
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
Project specific:
apply plugin: 'com.android.application'
apply plugin: 'robolectric'
apply from: 'config/quality.gradle'
dependencies {
compile files('libs/com.mobandme.ada_v2.4.4.jar')
compile 'com.squareup:otto:1.3.5'
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.github.pedrovgs:renderers:1.0.9'
compile 'com.jakewharton:butterknife:5.0.1'
compile 'com.etsy.android.grid:library:1.0.4'
compile 'ch.acra:acra:4.5.0'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:cardview-v7:21.0.2'
compile 'com.shamanland:fab:0.0.5'
compile 'com.github.johnkil.android-robototextview:robototextview:2.1.0'
compile 'com.path:android-priority-jobqueue:1.1.2'
compile "com.android.support:appcompat-v7:21.0.2"
compile 'com.jakewharton:disklrucache:2.0.2'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'com.snappydb:snappydb-lib:0.5.0'
compile 'com.esotericsoftware.kryo:kryo:2.24.0'
}
repositories{
flatDir{
dirs 'libs'
}
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.1'
defaultConfig {
minSdkVersion 18
targetSdkVersion 21
versionCode 113
versionName "1.0"
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}
signingConfigs {
release {
storeFile file('***')
storePassword '***'
keyAlias '***'
keyPassword '***'
}
}
lintOptions {
disable 'InvalidPackage'
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
productFlavors {}
}
And my travis file
language: java
jdk: oraclejdk7
env:
matrix:
- ANDROID_SDKS=android-21 ANDROID_TARGET=android-21
branches:
only:
- master
before_install:
- chmod +x gradlew
# Install base Android SDK
- wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
- tar xzf android-sdk_r23.0.2-linux.tgz
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
# install android build tools
- wget https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
- unzip build-tools_r21.1.1-linux.zip -d $ANDROID_HOME
- mkdir -p $ANDROID_HOME/build-tools/
- mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.1.1
- echo yes | android update sdk --filter build-tools-21.1.1 --no-ui --force > /dev/null
- echo yes | android update sdk --filter tools --no-ui --force > /dev/null
- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-21 --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-google-m2repository --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-google-google_play_services --no-ui --force > /dev/null
script:
- TERM=dumb ./gradlew assembleRelease
This is travis output
Using worker: worker-linux-docker-e8480109.prod.travis-ci.com:travis-linux-6
system_info
Build system information
Build language: java
Installing an SSH key from: default repository key
Key fingerprint: c3:f4:e6:fd:0c:b3:83:41:2a:d8:cd:ca:b1:3e:65:ca
git.checkout
1.15s$ git clone --depth=50 --branch=master git#github.com:colymore/firext-android.git colymore/firext-android
Cloning into 'colymore/firext-android'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
remote: Counting objects: 2088, done.
remote: Compressing objects: 100% (909/909), done.
remote: Total 2088 (delta 1137), reused 1840 (delta 912)
Receiving objects: 100% (2088/2088), 5.69 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1137/1137), done.
Checking connectivity... done.
$ cd colymore/firext-android
$ git checkout -qf 80a86aee1209b99d40d2b11d08292dba6958dbbd
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables. See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
Setting environment variables from .travis.yml
$ export ANDROID_SDKS=android-21
$ export ANDROID_TARGET=android-21
$ jdk_switcher use oraclejdk7
Switching to Oracle JDK7 (java-7-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-7-oracle
$ export TERM=dumb
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
$ javac -version
javac 1.7.0_60
before_install.1
0.01s$ chmod +x gradlew
before_install.2
1.19s$ wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
--2014-11-30 13:29:31-- http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
Resolving dl.google.com (dl.google.com)... 74.125.228.97, 74.125.228.98, 74.125.228.99, ...
Connecting to dl.google.com (dl.google.com)|74.125.228.97|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 140827643 (134M) [application/x-tar]
Saving to: `android-sdk_r23.0.2-linux.tgz'
100%[======================================>] 140,827,643 118M/s in 1.1s
2014-11-30 13:29:33 (118 MB/s) - `android-sdk_r23.0.2-linux.tgz' saved [140827643/140827643]
before_install.3
1.37s$ tar xzf android-sdk_r23.0.2-linux.tgz
before_install.4
0.00s$ export ANDROID_HOME=$PWD/android-sdk-linux
before_install.5
0.00s$ export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
before_install.6
0.38s$ wget https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
--2014-11-30 13:29:34-- https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
Resolving dl-ssl.google.com (dl-ssl.google.com)... 74.125.22.136, 74.125.22.190, 74.125.22.91, ...
Connecting to dl-ssl.google.com (dl-ssl.google.com)|74.125.22.136|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32642454 (31M) [application/zip]
Saving to: `build-tools_r21.1.1-linux.zip'
100%[======================================>] 32,642,454 109M/s in 0.3s
2014-11-30 13:29:34 (109 MB/s) - `build-tools_r21.1.1-linux.zip' saved [32642454/32642454]
before_install.7
0.71s$ unzip build-tools_r21.1.1-linux.zip -d $ANDROID_HOME
Archive: build-tools_r21.1.1-linux.zip
creating: /home/travis/build/colymore/firext-android/android-sdk-linux/android-5.0/
inflating: /home/travis/build/colymore/firext-android/android-sdk-linux/android-5.0/NOTICE.txt
before_install.8
0.01s$ mkdir -p $ANDROID_HOME/build-tools/
before_install.9
0.01s$ mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.1.1
before_install.10
3.17s$ echo yes | android update sdk --filter build-tools-21.1.1 --no-ui --force > /dev/null
Error: Ignoring unknown package filter 'build-tools-21.1.1'
before_install.11
1.19s$ echo yes | android update sdk --filter tools --no-ui --force > /dev/null
before_install.12
2.30s$ echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
before_install.13
7.11s$ echo yes | android update sdk --filter android-21 --no-ui --force > /dev/null
before_install.14
3.12s$ echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
before_install.15
4.00s$ echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
before_install.16
3.19s$ echo yes | android update sdk --filter extra-google-m2repository --no-ui --force > /dev/null
before_install.17
3.89s$ echo yes | android update sdk --filter extra-google-google_play_services --no-ui --force > /dev/null
56.27s$ ./gradlew assemble
Downloading https://services.gradle.org/distributions/gradle-2.1-all.zip
[Downloads..]
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library
:Firext:prepareComAndroidSupportCardviewV72102Library
:Firext:prepareComAndroidSupportSupportV42102Library
:Firext:prepareComEtsyAndroidGridLibrary104Library
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library
:Firext:prepareComShamanlandFab005Library
:Firext:prepareComSnappydbSnappydbLib050Library
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl
:Firext:compileDebugRenderscript
:Firext:generateDebugBuildConfig
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets
:Firext:generateDebugResValues
:Firext:generateDebugResources
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 28.369 secs
The command "eval ./gradlew assemble" failed. Retrying, 2 of 3.
WARNING: Dependency org.json:json:20080701 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk UP-TO-DATE
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:Firext:prepareComAndroidSupportCardviewV72102Library UP-TO-DATE
:Firext:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:Firext:prepareComEtsyAndroidGridLibrary104Library UP-TO-DATE
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library UP-TO-DATE
:Firext:prepareComShamanlandFab005Library UP-TO-DATE
:Firext:prepareComSnappydbSnappydbLib050Library UP-TO-DATE
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl UP-TO-DATE
:Firext:compileDebugRenderscript UP-TO-DATE
:Firext:generateDebugBuildConfig UP-TO-DATE
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets UP-TO-DATE
:Firext:generateDebugResValues UP-TO-DATE
:Firext:generateDebugResources UP-TO-DATE
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 11.542 secs
The command "eval ./gradlew assemble" failed. Retrying, 3 of 3.
WARNING: Dependency org.json:json:20080701 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk UP-TO-DATE
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:Firext:prepareComAndroidSupportCardviewV72102Library UP-TO-DATE
:Firext:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:Firext:prepareComEtsyAndroidGridLibrary104Library UP-TO-DATE
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library UP-TO-DATE
:Firext:prepareComShamanlandFab005Library UP-TO-DATE
:Firext:prepareComSnappydbSnappydbLib050Library UP-TO-DATE
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl UP-TO-DATE
:Firext:compileDebugRenderscript UP-TO-DATE
:Firext:generateDebugBuildConfig UP-TO-DATE
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets UP-TO-DATE
:Firext:generateDebugResValues UP-TO-DATE
:Firext:generateDebugResources UP-TO-DATE
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 11.423 secs
The command "eval ./gradlew assemble" failed 3 times.
The command "./gradlew assemble" failed and exited with 1 during .
Your build has been stopped.
To Top
Tip:
Did you know that you can split a build into several smaller pieces? Learn more
How can we help?
Support Ticket
Live Chat
E-Mail us
Documentation
Running Jobs (0)
There are no jobs
Queue (0)
There are no jobs
Update: VM images already include fixed android-wait-for-emulator script and android SDK tools version 24.0.0 by default solving issues I commented.
Solution - issue 1: Appcompat v21.0.2
I suggest you try to update platform-tools before tools.
Tools 23.0.5 requires platform-tools 19+, so i don't think you are updating it.
And appcompat-v7:21.0.2 requires last android-m2repository that requires tools 23.0.5.
Update: If I'm right about the issue2, you are using their pre-installed SDK, so you are updating tools correctly because they preinstalled platform-tools v20 but if you solve issue2, your problem will be issue1. I'm not sure about issue 2 because you use language:java, I use language:android. Check the path and search their SDK tools echo $PATH.
Alternative: If I'm wrong and your problems persist. I see you include a library that could depen on android-support-v4 and appcompat-v7.
Check dependencies conflicts.
- ./gradlew androidDependencies
- ./gradlew -q :Firext:dependencies
- ./gradlew -q :Firext:dependencyInsight --dependency support-v4 --configuration compile
- ./gradlew -q :Firext:dependencyInsight --dependency appcompat-v7 --configuration compile
You need version 21.0.2 from android.m2repository, you can try to exclude them.
compile files('libs/com.mobandme.ada_v2.4.4.jar') {
exclude group: 'com.android.support'
}
Solution - issue 2: Builds-tools aapt not found
I read in your log that build-tools/aapt is not found. You are adding ANDROID_HOME to the end of PATH, but Travis-ci already did first, so you are using their tools/android at usr/local/android-sdk-23.0.2 that includes build-tools v20.0.0 no 21.1.1.
As you are using docker and you can not update tools to 23.0.5 there due to another issue, you can use my work around so you save already installed platforms and system-images and can use old tools/android to update to 23.0.5. You don't need download it using wget:
- echo "WARNING! delete when fixed"; export OLD_SDK=/usr/local/android-sdk-23.0.2
- cp -R ${OLD_SDK}/tools ${SDK}/tools || echo "SDK tools copy failed."
- cp -R ${OLD_SDK}/platforms ${SDK}/platforms || echo "SDK platforms copy failed."
- cp -R ${OLD_SDK}/system-images ${SDK}/system-images || echo "SDK system-images copy failed."
or wait they update VM images soon
or change the order, so you use your SDK:
- export ANDROID_HOME=${TRAVIS_BUILD_DIR}/android-sdk-linux
- export PATH=${ANDROID_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
Suggestion:
you don't need download build-tools using wget.
I'm currently using this for updates:
- echo "LIST SUGGESTED SDK PACKAGES"; android list sdk -e || true
- echo "LIST AVAILABLE SDK PACKAGES"; android list sdk -a -e || true
- echo "UPDATE PACKAGES IF REQUIRED"; echo y | android update sdk -u -t platform-tool,tool,\
extra-android-support,extra-google-google_play_services,\
extra-android-m2repository,extra-google-m2repository,\
android-19,sys-img-armeabi-v7a-android-19,\
android-18,sys-img-armeabi-v7a-android-18,\
android-17,sys-img-armeabi-v7a-android-17,\
android-16,sys-img-armeabi-v7a-android-16,\
android-15,sys-img-armeabi-v7a-android-15 || true
- echo "UPDATE PACKAGES IF POSSIBLE"; echo y | android update sdk -a -u -t ${BUILD_TOOLS},\
android-20,android-21,${SDK_EXTRA_PKGS:-} || true
- echo "LIST SDK UPDATES BY FILTERS"; android update sdk -u -n -t platform,system-image,\
add-on,extra || true
Related
My Android project has two product flavour FlavourOne & FlavourTwo and BuildType Debug & Release.
My project src directory has
main
FlavourOneDebug
FlavourOneRelease
FlavourTwoDebug
FlavourTwoRelease
xxx.xxx.test.constant.FlavourConstant is placed in FlavourOneDebug, FlavourOneRelease, FlavourTwoDebug, FlavourTwoRelease and not in main directory
xxx.xxx.test.MainActivity which is placed in main directory imports FlavourConstant
here is my travis.yml
language: android
sudo: required
jdk: oraclejdk8
android:
components:
# The BuildTools version used by your project
- build-tools-26.0.2
# The SDK version used to compile your project
- android-26
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
before_install:
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
script:
- ./gradlew build --stacktrace
Travis CI failed to reference FlavourConstant from product flavour directory.
Reference to Travis failed job https://travis-ci.org/KarthikUCH/MokaTest/jobs/527169383
Finally managed to solve the issue, which is actually caused by the flavour source set directory naming.
The Gradle task in Travis expects the flavour directory to be CaseSensitive.
Changed the directory naming form flavoruonedebug to flavoruoneDebug solved the issue
I have an issue with running Gitlab CI, source code below:
image: openjdk:8-jdk
stages:
- build
- test
- package
#####################################################################
# BUILD
#
.build_template: &build_template_def
stage: build
artifacts:
expire_in: 4 hours
paths:
- app/build/outputs/
- .android/
before_script:
# Extract the SDK version that we're building against
- export ANDROID_COMPILE_SDK=`egrep '^[[:blank:]]+compileSdkVersion' app/build.gradle | awk '{print $2}'`
# Explict output for logging purpose only
- echo $ANDROID_SDK_TOOLS
- echo $ANDROID_COMPILE_SDK
# Fetch the specified SDK tools version to build with
- wget --quiet --output-document=/tmp/sdk-tools-linux.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip /tmp/sdk-tools-linux.zip -d .android
# Set up environment variables
- export ANDROID_HOME=$PWD/.android
- export PATH=$PATH:$PWD/.android/platform-tools/
# Install platform tools and Android SDK for the compile target
- echo y | .android/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
- chmod +x ./gradlew
build_debug:
<<: *build_template_def
tags:
- buildtag
only:
- develop
- tags
script:
- ./gradlew assembleDebug
build_release:
<<: *build_template_def
only:
- master
script:
- ./gradlew assembleRelease
Even after addition of tags to the jobs, it is saying that stuck.
Also tried changing:
variables:
ANDROID_COMPILE_SDK: "27"
ANDROID_BUILD_TOOLS: "27.0.3"
ANDROID_SDK_TOOLS: "4333796"
Anybody who faced this issue, especially for android project.
I'm trying to build an Android project using CircleCI, but every time I run a build, the build completes in the Configure Build task and I get this message:
Some errors occurred while attempting to infer information about your code.
Also, when this occurs, CircleCI automatically tries to rebuild the branch, causing a loop, because every new build keeps failing.
Here's my circle.yml file
version: 1
machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
dependencies:
pre:
# Install the android packages
- echo y | android update sdk --no-ui --all --filter "build-tools-25.0.3"
test:
pre:
override:
# Generate a debug-apk
- ./gradlew assembleAppseeOffDebug -PdisablePreDex
# Copy the generated apk files to Circle-CI Artifacts
- cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS
# Copy the test results to Circle-CI Artifacts
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
Solved the problem by following this circle.yml example
In 1, after the test tag there's an override tag, but in my circle.yml file there's a pre tag. Removing that pre tag solved the problem.
Final circle.yml file
version: 1
machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
dependencies:
pre:
# Install the android packages
- echo y | android update sdk --no-ui --all --filter "build-tools-25.0.3
test:
# REMOVED pre TAG
override:
# Generate a debug-apk
- ./gradlew assembleAppseeOffDebug -PdisablePreDex
# Copy the generated apk files to Circle-CI Artifacts
- cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS
# Copy the test results to Circle-CI Artifacts
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
I am using retrolambda in my Android application, and using circleci.com as continuous integration for my github repo.
the problem is I have configured my local mac environment for Java_Home and Java7_Home, and everything is okay, but I don't know how to config circleci yml file for this problem.
here is my application repo:
https://github.com/mmirhoseini/weather_app
here is my local configurations on .bash_profile file:
export JAVA_HOME=`/usr/libexec/java_home`
export JAVA7_HOME=`/usr/libexec/java_home -v 1.7`
this is my circleci.yml file:
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/weather_app/app/build/outputs/apk/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
java:
version: openjdk8
dependencies:
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
- (./gradlew assemble):
timeout: 360
- (./gradlew test):
timeout: 360
and here is the circleci error log:
> Building 10%When running gradle with java 8, you must set the path to the old jdk, either with property retrolambda.oldJdk or environment variable JAVA5_HOME/JAVA6_HOME/JAVA7_HOME
please help...
finally problem solved, I prepared environment by downloading older java version and setting Java6_home and after that build and run my tests.
here is my circleci.yml file:
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/weather_app/app/build/outputs/apk/
- /usr/lib/jvm/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
JAVA6_HOME: /usr/lib/jvm/java-6-openjdk-amd64
java:
version: openjdk8
dependencies:
override:
- echo y | sudo apt-get update
- echo y | sudo apt-get install libpango-1.0-0
- echo y | sudo apt-get install openjdk-6-jre
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
- (./gradlew assemble):
timeout: 360
- (./gradlew test):
timeout: 360
I am using a CircleCI server to build and test and Android application and have trouble installing the Android SDK for Google Play Services (including GMS services) on the server.
My circle.yml file is:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
dependencies:
pre:
- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository
- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all
- wget $DEBUG_KEYSTORE_URL
- openssl des3 -d -pass env:DEBUG_KEYSTORE_PASSWORD -salt -in debug.keystore.encrypted -out ~/.android/debug.keystore
test:
override:
- ./gradlew assembleDebug
post:
- cp -r app/build/outputs $CIRCLE_ARTIFACTS
The first
- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository
was a fix for an earlier issue with the Android SDK extras, and I thought that the second line would install all remaining components:
- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all
However, I am getting the following error (below).
When trying to keep my circle.yml file up to date with the latest Android SDK, I seem to keep running into similar issues. Any suggestions are appreciated!
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0-beta1/gradle-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0-beta1/gradle-core-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0-beta1/builder-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0-beta1/lint-24.3.0-beta1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.2.1/proguard-parent-5.2.1.pom
Download https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.3.6/groovy-all-2.3.6.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0-beta1/builder-model-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0-beta1/builder-test-api-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0-beta1/sdklib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0-beta1/sdk-common-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0-beta1/common-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0-beta1/manifest-merger-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0-beta1/ddmlib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0-beta1/lint-checks-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0-beta1/annotations-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0-beta1/layoutlib-api-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0-beta1/dvlib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0-beta1/lint-api-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.pom
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0-beta1/gradle-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0-beta1/gradle-core-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0-beta1/builder-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0-beta1/lint-24.3.0-beta1.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar
Download https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.3.6/groovy-all-2.3.6.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0-beta1/builder-model-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0-beta1/builder-test-api-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0-beta1/sdklib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0-beta1/sdk-common-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0-beta1/common-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0-beta1/manifest-merger-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0-beta1/ddmlib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0-beta1/lint-checks-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0-beta1/annotations-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0-beta1/layoutlib-api-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0-beta1/dvlib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0-beta1/lint-api-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.jar
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.google.android.gms:play-services-maps:7.5.0.
Searched in the following locations:
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
https://maven.fabric.io/public/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
https://maven.fabric.io/public/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
Required by:
project-android-app:app:unspecified
> Could not find com.google.android.gms:play-services-location:7.5.0.
Searched in the following locations:
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
https://maven.fabric.io/public/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
https://maven.fabric.io/public/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
Required by:
project-android-app:app:unspecified
> Could not find com.google.android.gms:play-services-gcm:7.5.0.
Searched in the following locations:
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
https://maven.fabric.io/public/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
https://maven.fabric.io/public/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
Required by:
project-android-app:app:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
export TERM="dumb"
./gradlew dependencies
returned exit code 1
Total time: 19.331 secs Action failed: ./gradlew dependencies
The solution after much tweaking seems to require you to explicitly specify the components you need in the --filter option. If you don't add filter, it appears that --all will NOT give you all the components needed.
Fix is below for others:
ssh
dependencies:
pre:
- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository
I got this same error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not find com.google.android.gms:play-services-location:7.5.0.
This tip below solved the problem:
echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository