3

我遵循了将我的 AAR 文件发布到 JCenter 所需的每个步骤,然后使用https://github.com/danielemaddaluno/gradle-jcenter-publish将其与 Maven Central 同步。我按照他的第 13 步和第 14 步编写了这个命令,得到了这个错误:

G:\Android 开发应用程序\android-studio\gradle\gradle-2.2.1\bin>gradle bintrayUpload

FAILURE:构建失败并出现异常。

  • 出了什么问题:
    在根项目“bin”中找不到任务“bintrayUpload”。

build.gradle(项目:xxxx)

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.1.2'
    classpath 'com.github.dcendents:android-maven-plugin:1.2'
    classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {

apply plugin: 'com.jfrog.bintray'

repositories {
    jcenter()
}
}
4

1 回答 1

2

由于系统环境变量中缺少 JDK 和 JRE“bin”路径,可能会发生此错误。

只需在环境变量中添加 JDK 和 JRE“bin”文件夹的路径即可。

要添加路径,请执行以下步骤:

第 1 步:右键单击,在我的电脑/这台电脑上(Windows 8.1)。

第 2 步:单击属性。

第 3 步:单击左侧菜单中的高级系统设置,将打开一个对话框。

第 4 步:带有高级选项卡的对话框,移至对话框末尾并单击“环境变量”按钮。

第 5 步:在系统变量中,在变量路径/PATH中添加 JDK 和 JRE 的路径。

Example of JDK and JRE path : 

C:\Program Files (x86)\Java\jre1.8.0_40\bin

C:\Program Files\Java\jre1.8.0_31\bin
于 2015-04-27T04:50:19.110 回答