Travis CI for Android - Build Error: Could not find target and could not find dependencies

I am trying to configure Travis CI for my existing Android project. I added .travis.yml:

language: android android: components: - build-tools-21.1.2 - android-22 - extra-google-google_play_services 

But it always fails in Travis CI with the following error:

 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':evercamPlay'. 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: 16.801 secs The command "./gradlew build connectedCheck" exited with 1. Done. Your build exited with 1. 

What should I do to get rid of this error?


Update:
After updating the build tools to version 22.0.1, this error disappeared, but a new error appeared:

 > Could not find com.android.support:support-v4:22.2.0. ... > Could not find com.google.android.gms:play-services:7.3.0. ... 

In my build.gradle file:

 dependencies { compile 'com.android.support:support-v4:22.2.0' compile 'com.google.android.gms:play-services:7.3.0' } 

Any idea how to fix this?

Thanks!

+5
source share
3 answers

You need to update the build tools to version 22.X, I tried in my project configuration and it works.

 android: components: - android-22 - build-tools-22.0.1 
+6
source

It is also possible that Travis has not yet been updated with the corresponding sdks. From their documents (as of June 9, 2015):

Pre-installed components #

While the following components are preinstalled, the exact list is subject to change without notice. To ensure the stability of your build environment, we recommend that you explicitly specify the necessary components for your project.

  • Platform tools
  • Build-Tools-21.1.1
  • android 21
  • SYS-IMG-armeabi-v7a-android-21
  • android 20
  • SYS-IMG-armeabi-v7a-android-wear-20
  • 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
  • android 10
  • extra android support
  • extra-google-google_play_services
  • extra-google-m2repository
  • extra android m2repository

There is no mention of v22 sdk or build tools there.

+2
source
 language: android android: components: - platform-tool - tool - android-22 - build-tools-22.0.1 - extra-android-m2repository - extra-google-m2repository 
+1
source

All Articles