我遵循了将 AAR 文件发布到 JCenter 所需的每个步骤,然后使用 Maven Central 将其同步https://github.com/danielemaddaluno/gradle-jcenter-publish https://github.com/danielemaddaluno/gradle-jcenter-publish。
我按照他的步骤 13 和步骤 14 编写了此命令并收到此错误:
G:\Android Development Application\android-studio\gradle\gradle-2.2.1\bin>gradle bintrayUpload
失败:构建失败并出现异常。
- 什么地方出了错:
在根项目“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()
}
}
出现此错误的原因可能是系统环境变量中缺少 JDK 和 JRE“bin”路径。
只需在环境变量中添加 JDK 和 JRE“bin”文件夹的路径即可。
要添加路径,请执行以下步骤:
步骤 1:右键单击,在我的电脑/此电脑 (Windows 8.1) 上。
第 2 步:单击“属性”。
步骤 3 : 单击左侧菜单中的高级系统设置,将打开一个对话框。
第 4 步:打开“高级”选项卡对话框,移至对话框末尾并单击“环境变量”按钮。
步骤5:在系统变量中,在变量中添加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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)