Публикации указаны, но в проекте нет публикаций :library

Я пытаюсь загрузить свою библиотеку в репозиторий JCenter. Я следовал этому руководству:

https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/

Мой build.gradle для библиотеки после выполнения команды gradlew bintrayUpload.

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

// This is the library version used when deploying the artifact
version = "1.0.0"

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}

def siteUrl = 'https://github.com/vipulasri/Layout-to-Image'      
def gitUrl = 'https://github.com/vipulasri/Layout-to-Image.git'   
group = "com.github.vipulasri"                    

install {
repositories.mavenInstaller {
    // This generates POM.xml with proper parameters
    pom {
        project {
            packaging 'aar'

            // Add your description here
            name 'Layout to Image'
            description = 'The project aims to convert your Android   Layout Xml to Image'
            url siteUrl

            // Set your license
            licenses {
                license {
                    name 'The Apache Software License, Version 2.0'
                    url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                }
            }
            developers {
                developer {
                    id 'vipulasri'
                    name 'Vipul Asri'
                    email '[email protected]'
                }
            }
            scm {
                connection gitUrl
                developerConnection gitUrl
                url siteUrl

            }
        }
    }
}
}


dependencies {
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath +=      project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

task findConventions << {
println project.getConvention()
}




Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())


bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")


configurations = ['archives']

pkg {
    repo = "maven"
    // it is the name that appears in bintray when logged
    name = "layouttoimage"
    websiteUrl = siteUrl
    vcsUrl = gitUrl
    licenses = ['Apache-2.0']
    publish = true

}
}

Я получил следующую ошибку:

Publications(s) specified but no publications exist in project :library.                 
:app:bintrayUpload FAILED         

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':app:bintrayUpload'.
> No value has been specified for property 'packageName'.
> No value has been specified for property 'repoName'.
> No value has been specified for property 'apiKey'.
> No value has been specified for property 'user'.

* Try:       
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED 

person Vipul Asri    schedule 28.04.2015    source источник
comment
Какую версию градла вы используете?   -  person Dror Bereznitsky    schedule 28.04.2015
comment
путь к классам 'com.android.tools.build: gradle: 1.1.2'   -  person Vipul Asri    schedule 29.04.2015
comment
У вас есть раздел buildScript в файле build.gradle?   -  person Dror Bereznitsky    schedule 03.05.2015
comment
да, у меня есть раздел buildScript в моем build.gradle   -  person Vipul Asri    schedule 03.05.2015


Ответы (2)


Я просто решаю эту проблему, мое решение - отредактировать верхнюю часть проекта build.gradle, включить classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2" и отключить //plugins { // id "com.jfrog.bintray" version "1.2" //}

Это работает для меня, надеюсь, полезно для вас.

person Derlio    schedule 10.05.2015
comment
Я использовал плагин для применения: com.jfrog.bintray в моем build.gradle, удаление которого решило мою проблему. Спасибо @Derilo - person Vipul Asri; 11.05.2015

Ваш верхний уровень Build.gradle должен содержать этот код для успешной сборки 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.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 {

repositories {
    jcenter()
}
}
person Vipul Asri    schedule 13.05.2015