Android 特拉维斯 CI 错误 : failed to find target with hash string 'android-23' in:/usr/local/android-sdk

标签 android testing travis-ci

我正在尝试学习如何在 Android 中使用 Travis CI,但是当我将我的代码推送到 Github 时,Travis CI 给我一个错误:failed to find target with hash string 'android-23 ' 在:/usr/local/android-sdk,

我的 .travis.yml 文件是:

language: android
android:
  components:
    - build-tools-23.0.0
    - android-L
    - sys-img-x86-android-tv-l
    - add-on
    - extra
script: ./gradlew assembleDebug

我的build.gradle文件是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "xhome.uestcfei.com.loadingpoppointdemo"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile project(':loadingpoppoint')
}

我是 Travis CI 的新手,我通过谷歌搜索解决方案,有针对此错误的解决方案,但仅适用于本地编译而不适用于 Travis CI。有人可以帮我吗?

真的非常感谢!

最佳答案

尝试在 .travis.ymlcomponents: 部分添加下一行:

- android-23

所以,完整的 .travis.yml 将是:

language: android
android:
  components:
    - build-tools-23.0.0
    - android-23
    - android-L
    - sys-img-x86-android-tv-l
    - add-on
    - extra
script: ./gradlew assembleDebug

有关详细信息,请参阅 Building an Android Project (beta)

关于Android 特拉维斯 CI 错误 : failed to find target with hash string 'android-23' in:/usr/local/android-sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35198143/

相关文章:

android - 我是否需要清除/清空自定义 View 中的 View 绑定(bind)字段?

nhibernate - 如何测试直接使用NHibernate的服务层?

testing - 在像敏捷开发中,谁应该编写测试用例?

java - HashMap 与值不匹配

android - 将图像作为 json 条目发送 android

java - 如何知道一个jobobject所属的jclass(JNI)

java - 我可以使用 TestFX 和 JUnit 测试舞台按钮或警报对话框吗?

go - 如何部署 travis 自动构建,我的失败了,我不知道如何修复

android - 无法配置 travis 以在 android 项目上工作

java - 写入文件的 JUnit 测试在本地通过但在 Travis CI 上失败