【发布时间】:2015-10-24 18:36:02
【问题描述】:
我正在尝试将我的库上传到 jCenter。我正在关注本教程:
http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
按照这些步骤并开始在 Android 终端中输入 "> gradlew bintrayUpload" 我收到以下错误:
:app:bintray上传失败
FAILURE:构建失败并出现异常。
- 出了什么问题:
发现任务 ':app:bintrayUpload' 的配置存在一些问题。
没有为属性“packageName”指定值。 没有为属性“用户”指定值。 没有为属性“apiKey”指定值。 没有为属性“repoName”指定值。
在将我的问题标记为重复之前,我将表明我尝试了以下 stackoverflow 问题的解决方案:
Publications(s) specified but no publications exist in project :library
尝试该解决方案后,我收到以下错误:
FAILURE:构建失败并出现异常。
- 出了什么问题:
在根项目“UniFont”中找不到任务“bintrayUpload”。
搜索这个错误,我从stackoverflow上的这个问题得到以下解决方案: Task 'bintrayUpload' not found in root project 'bin'
这不是我的解决方案。我的 jdk/jre 路径存在。我曾多次尝试在它们之间切换。可选问题:
是否需要将 JDK 和 JRE 路径都声明到 Windows 环境变量中?
这是我的顶级 build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// 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()
}
}
这是我的 build.gradle(app 模块):
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
ext {
bintrayRepo = 'maven'
bintrayName = 'Library Name'
publishedGroupId = '...'
libraryName = '...'
artifact = '...'
libraryDescription = 'A simple library for setting a single font in a View in Android.'
siteUrl = '...'
gitUrl = '...'
libraryVersion = '1.0'
developerId = '...'
developerName = '...'
developerEmail = '...'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
谁能帮我解决这个问题?
谢谢!
【问题讨论】:
-
你在
local.properties声明你的apiKey了吗? -
是的。我已经声明了我的 apiKey。
-
github.com/danielemaddaluno/gradle-jcenter-publish 我现在用这个。它说“无法解析符号:pom”。我在另一个教程中遇到了这个问题。你有同样的问题吗?
-
谢谢!但我仍然有同样的问题:“无法解析符号:pom”。你可以上传你的 build.gradle 文件和你使用的 gradle 版本吗?这对我有很大帮助。
-
好的,我添加了。希望对您有所帮助;)
标签: android maven gradle android-gradle-plugin jcenter