我正在开发Android库开发,我已经完成了我的库工作并生成了aar和jar文件,但是当我尝试发布到二进制文件时,我收到一条错误消息。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mylittlelibrary:bintrayUpload'.
> Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.391 secs
Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
2:41:59 AM: External task execution finished 'bintrayUpload'.
的build.gradle
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
repositories {
mavenCentral()
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
}
group = 'helloaar.example.com.mylittlelibrary'
version = '1.0.2'
task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}
task generateJavaDocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
}
task generateJavaDocsJar(type: Jar) {
from generateJavaDocs.destinationDir
classifier 'javadoc'
}
generateJavaDocsJar.dependsOn generateJavaDocs
bintray {
user = 'abcd'
key = '1234567890fghgfhffjfgjfjfjrtyjtkjg'
pkg {
repo = 'maven'
name = 'helloaar.example.com.mylittlelibrary'
version {
name = '1.0.2'
desc = 'My test upload'
released = new Date()
vcsTag = '1.0.2'
}
licenses = ['Apache-2.0']
vcsUrl = ''
websiteUrl = ''
}
configurations = ['archives']
}
artifacts {
archives generateJavaDocsJar
archives generateSourcesJar
}
请仔细阅读我的脚本并向我推荐一些解决方案。
答案 0 :(得分:2)
在发布到Bintray之前,您必须拥有稳定的代码构建。 Bintray的层次结构如下: 用户 - >回购 - >包 - >版本 - >神器 意味着Repo应该高于该层次结构的包。
gradle.build中的以下行可能是导致错误的主要原因:
pkg {
repo = 'maven'
name = 'helloaar.example.com.mylittlelibrary'
}
层次结构错误。
使用maven时,应检查是否符合maven约定,否则Maven Build无法成功。 Explanation for Maven Repositories on Bintray.
你遇到的错误:
HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
意味着您在Bintray上没有存储库调用maven。所有软件包版本和文件都应该在您创建的Bintray存储库下。
有关更多详细信息或支持问题,您可以使用适用于所有Bintray用户的Bintray support团队,并可以帮助您解决与任何JFrog平台服务相关的任何问题,例如Bintray,Artifactory,Mission control& X射线。
答案 1 :(得分:0)
pkg {
repo = 'maven'
name = 'helloaar.example.com.mylittlelibrary'
version {
name = '1.0.2'
desc = 'My test upload'
released = new Date()
vcsTag = '1.0.2'
}
Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
2:41:59 AM: External task execution finished 'bintrayUpload'.
<强> 'ABCD /行家/ helloaar.example.com.mylittlelibrary'强>
-
我希望对你有所帮助,祝你有个美好的一天