3

我在将 android studio 3.0.1 更新到 3.1 时遇到以下问题

找不到 android-maven-gradle-plugin.jar (com.github.dcendents:android-maven-gradle-plugin:1.5)。在以下位置搜索: https ://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.5/android-maven-gradle-plugin-1.5.jar

下面是我的 build.gradle

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.novoda:bintray-release:0.3.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'io.fabric.tools:gradle:1.24.4'
    }
}

请帮忙

4

2 回答 2

3

得到解决方案,通过更新解决了错误

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

在 gradle-wrapper.properties 中使用:

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

并将buildToolsVersion更新为27.0.3

于 2018-03-29T06:45:12.923 回答
1

Gradle Android Maven 插件

要使用 android-maven-gradle-plugin,只需在您的 android-library 项目中应用该插件。还将插件类路径依赖项添加到 buildScript。

buildscript {
repositories {
    mavenCentral()
}

dependencies {
    classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

apply plugin: 'com.android.library'

apply plugin: 'com.github.dcendents.android-maven'

或使用 gradle 2.1

plugins {
 id "com.github.dcendents.android-maven" version "2.0"
}

您可以在脚本 build.gradle 中设置 maven groupId 和 version:

group = 'com.example'
version = '1.0'

在 settings.gradle 中设置:

rootProject.name = 'artifact'
于 2018-03-29T05:26:51.383 回答