我正在尝试学习如何在 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.yml
的 components:
部分添加下一行:
- 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/