Uni
Uni

Reputation: 187

Unspecified Android Library version when publishing to Bintray

I'm trying to publish my own Android library to Bintray but when I uploaded from gradle successfully. I always get unexpected result from Bintray. It looks like this

enter image description here

And this is my build.gradle

 apply plugin: 'com.android.library'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'


// for Bintray
def projectVersionCodeNr = Integer.parseInt(projectVersionCode);
def libGit = libGit
def libUrl = libUrl
def libDescription = libDescription
def libGroupId = libGroupId
def libArtifactId = libArtifactId

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.3"
    defaultConfig {
        minSdkVersion 19
        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 {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}

install {
    repositories.mavenInstaller {
        pom.project {
            name libArtifactId
            description libDescription
            url libUrl
            inceptionYear '2018'

            packaging 'aar'
            groupId libGroupId
            artifactId libArtifactId
            version '1.0.1'

            licenses {
                license {
                    name 'MIT'
                    url libLicenseUrl
                }
            }
        }
    }
}

bintray {
    user = bintray_user
    key = bintray_apikey
    pkg {
        repo = libGroupId
        name = libArtifactId
        userOrg = bintray_user_org
        licenses = ['MIT']
        vcsUrl = libGit
        version {
            name = '1.0.1'
            vcsTag = '1.0.1'
        }
    }
    configurations = ['archives']
}

What I want to have is others can download my libray just simply using

compile 'com.test.sdk:mylib:1.0.1'

Can everyone support me to resolve my problem? Thank you

Upvotes: 0

Views: 827

Answers (2)

Exel Staderlin
Exel Staderlin

Reputation: 535

Check Your POM Files dude. i have a same problem

and here's what i found in my POM files

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.pmberjaya.library</groupId>
  <artifactId>ticketing-report-adapter</artifactId>
  <version>unspecified</version>

you should add filesSpec in ur gradle inside bintray

   filesSpec {
    from 'ticketing-report-adapter/build/outputs/aar/ticketing-report-adapter-release.aar'
    into '.'
    version '1.0'
}

FULL

bintray  {
user = "bintray.user"
key = "bintray.key"
configurations = ['archives']
pkg {
    repo = "ticketing-report-adapter"
    name = "sdk"
    version {
        name = '1.0'
        desc = 'Ticketing Upload SDK'
        released  = new Date()
        vcsTag = '1.0'
    }
    licenses = ['Apache-2.0']

    vcsUrl = "https://gitlab.com/exelstaderlin/ticketing-android.git"
    websiteUrl = "https://gitlab.com/exelstaderlin/ticketing-android.git"
}

filesSpec {
    from 'ticketing-report-adapter/build/outputs/aar/ticketing-report-adapter-release.aar'
    into '.'
    version '1.0'
}

}

Upvotes: 0

Khang Tran
Khang Tran

Reputation: 467

I have a guide how to push Android Library to Bintray, you can try with my guide. I have already uploaded 2 libraries by this way.

Link library to bintray

Upvotes: 1

Related Questions