ci build android app,Travis CI Build在Android应用程序上失败不支持major.minor版本52

我正在尝试使用此.travis.yml文件在我的Android项目上使用Travis CI构建

language: android

android:

components:

- platform-tools

- tools

- build-tools-23.0.3

- android-23

- sys-img-armeabi-v7a-android-23

- sys-img-x86-android-23

这是我的app level build.gradle:

apply plugin: 'com.android.application'

android {

compileSdkVersion 23

buildToolsVersion "23.0.3"

defaultConfig {

applicationId "com.myname.myproject"

minSdkVersion 19

targetSdkVersion 23

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

debug{

testCoverageEnabled = true

}

}}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:23.4.0'

compile 'com.android.support:design:23.4.0'

testCompile "org.robolectric:robolectric:3.1.2"

testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'

testCompile 'junit:junit:4.12'

testCompile 'org.mockito:mockito-core:1.10.19'

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

exclude group: 'com.android.support', module: 'support-annotations'

})

}

我在特拉维斯CI上收到此失败消息:

FAILURE: Build failed with an exception.

* Where:

Build file '/home/travis/build/myname/myproject/app/build.gradle' line: 1

* What went wrong:

A problem occurred evaluating project ':app'.

> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or -- debug option to get more log output.

BUILD FAILED

从错误来看,它似乎与Java版本有关.我注意到Travis使用Java版本1.7.0_76.

android {

...

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_7

targetCompatibility JavaVersion.VERSION_1_7

}

}

更新:我通过添加jdk: oraclejdk8到我的.travis.yml文件的第二行后修复此问题language:android

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值