2015-04-28 9 views
1

Я пытаюсь загрузить свою библиотеку в Репозиторий JCenter. Я после этого учебника:Публикации (ы) указано, но в проекте нет публикаций: library

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 
+0

Какая версия Gradle вы используете? –

+0

classpath 'com.android.tools.build:gradle:1.1.2' –

+0

У вас есть секция buildScript в файле build.gradle? –

ответ

3

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

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

+0

Я использовал прикладной плагин: «com.jfrog.bintray» в моей сборке.gradle, удалив это, решил мою проблему. Спасибо @Derilo –

0

Ваш Верхний уровень 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() 
} 
}