【发布时间】:2018-08-09 07:33:17
【问题描述】:
使用来自 here 的建议,我无法将我的 android aar 上传到我的 Bintray 帐户。我使用gradlew bintrayUpload 获得了“构建成功”,但在 bintray 中只能看到 jar 文件和 pom 文件。
这是我的顶级 gradle 文件
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'maven'
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId 'com.android.me.mylibrary'
artifactId 'demo-lib'
version '1.0.1'
}
}
}
这是我的 gradle 文件
apply plugin: 'com.android.library'
bintray {
user = user
key = key
publications = ['MyPublication'] //When uploading Maven-based publication files
//configurations = ['archives']
pkg {
repo = repo
name = 'demo-lib'
userOrg = userorg
labels = ['aar', 'android', 'example']
version {
name = '1.0.1'
}
}
}
android {
compileSdkVersion 26
buildToolsVersion "27.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
testCompile 'junit:junit:4.12'
}
有什么遗漏吗? 我也尝试使用示例脚本here,但结果是一样的。 最好的问候...
【问题讨论】:
标签: android gradle android-library bintray