Tuesday, 16 June 2015

travis ci android 2

When i use :

language: android
jdk: oraclejdk7
env:
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
 
android:
components:
- build-tools-19.0.0
 
before_script:
# Create and start emulator
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
 
script: ./gradlew connectedAndroidTest





I got this error:


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'.
> failed to find target android-22 : /usr/local/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: 25.323 secs
The command "./gradlew connectedAndroidTest" exited with 1.
Done. Your build exited with 1.
/home/travis/.bash_logout: line 1: 2232 Killed emulator -avd test -no-skin -no-audio -no-window






solution:

Chang travis.yml to:

language: android
jdk: oraclejdk7
env:
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
 
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
 
# The BuildTools version used by your project
- build-tools-22.0.1
 
# The SDK version used to compile your project
- android-22
 
# Additional components
- extra-android-support
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-21
 
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-19
 
before_script:
# Create and start emulator
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
 
script: ./gradlew connectedAndroidTest



That is weird,  because I didn't specify the version 22, I was using 19, but it failed because of unable to find target android-22.......

And it also weird because people said travis does not have android 22 preinstalled:


http://stackoverflow.com/questions/30729943/travis-ci-for-android-build-error-failed-to-find-target-could-not-find-depe












No comments:

Post a comment