Android O Gradle build fails with travis ci

≡放荡痞女 提交于 2019-12-08 01:10:45

问题


I'm trying to use Travis CI for my Android Project but my Builds constantly failing but works on local build. I am using Android Studio Preview 3 and gradle 3 alpha 3.

I am getting this error below.

Could not find com.android.tools.build:gradle:3.0.0-alpha3.

Here is my build log

My Travis Config file

My Project gradle file


回答1:


I'm getting an Access denied error to your build log, and I didn't use it, but I'll try to answer you.

As announced here:

The Android Gradle Plugin 3.0.0-alpha3 was also released through maven.google.com.

You can try to fix it by adding Google’s Maven Repository here like this:

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

As commented here, this version doesn't exist in Bintray JCenter:

com.android.tools.build.gradle latest version is 2.5.0-alpha-preview-02, there is no 3.0.0-alpha3

Also be sure to update build tools to the latest version as suggested in this related question:

Update your build tools from SDK manager

I add links to samples using the new sdkmanager command line here.

I would need a sample project reproducing the issue to check my suggestions.



来源:https://stackoverflow.com/questions/44406647/android-o-gradle-build-fails-with-travis-ci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!