2015-04-15 5 views
5

मैं एक एंड्रॉइड लाइब्रेरी को जेंटर पर प्रकाशित करने की कोशिश कर रहा हूं। मैंने https://github.com/danielemaddaluno/gradle-jcenter-publish ट्यूटोरियल का पालन किया है। सब कुछ ठीक काम करता है जब तक मैं जब मैं तो मैं एक बिल्ड विफल मिलता है निष्पादित करने के लिएएंड्रॉइड लाइब्रेरी को जेंटर पर प्रकाशित करें: gradle bintrayUpload लाइब्रेरी नहीं ढूंढता

gradle bintrayUpload

प्रयास करें। जब मैं त्रुटियों पर गौर मैं

package com.android.volley does not exist

इसलिए पुस्तकालयों है कि मैं एक Gradle निर्भरता के रूप में शामिल किया है

dependencies { 
    compile 'com.mcxiaoke.volley:library:1.+' (...) 
} 

अन्य पुस्तकालयों के साथ एक ही happends शामिल पाया नहीं किया जा रहा है देखते हैं।

मैं इस समस्या को कैसे ठीक कर सकता हूं?

मैं build.gradle

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

android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.2" 

    defaultConfig { 
     minSdkVersion 8 
     targetSdkVersion 22 
     versionCode 1 
     versionName "0.0.1" 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile 'com.mcxiaoke.volley:library:1.+' 
    compile 'com.shamanland:fab:0.0.8' 
    compile 'com.google.code.gson:gson:2.2.4' 
    compile 'com.android.support:appcompat-v7:22.0.0' 
    compile 'com.android.support:gridlayout-v7:21.0.3' 
} 

def siteUrl = "SOME_URL" 
def gitUrl = 'SOME_URL' 
group = "GROUP_ID" 
install { 
    repositories.mavenInstaller { 
     // This generates POM.xml with proper parameters 
     pom { 
      project { 
       packaging 'aar' 

       // Add your description here 
       name 'NAME' 
       description = 'DESCRIPTION' 
       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 'MY_ID' 
         name 'MY_NAME' 
         email 'MY_EMAIL' 
        } 
       } 
       scm { 
        connection gitUrl 
        developerConnection gitUrl 
        url siteUrl 
       } 
      } 
     } 
    } 
} 



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 
} 

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

// https://github.com/bintray/gradle-bintray-plugin 
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 = "androidupdatechecker" 
     websiteUrl = siteUrl 
     vcsUrl = gitUrl 
     licenses = ["Apache-2.0"] 
     publish = true 
     version { 
      gpg { 
       sign = true //Determines whether to GPG sign the files. The default is false 
       passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing' 
      } 
//   mavenCentralSync { 
//    sync = true //Optional (true by default).  Determines whether to sync the version to Maven Central. 
//    user = properties.getProperty("bintray.oss.user")   //OSS user token 
//    password = properties.getProperty("bintray.oss.password") //OSS user password 
//    close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually. 
//   } 
     } 
    } 
} 

मॉड्यूल और परियोजना build.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.1.2' 
     classpath 'com.github.dcendents:android-maven-plugin:1.2' 
     classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1" 

    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 
+0

पोस्ट अपने build.gradle –

+0

@GabrieleMariotti फ़ाइलों – Mateu

+0

ही यहां मुद्दा यह कहा, मैं अगर मैं एक समाधान खोजने के अपडेट करेंगे। क्या आपने कभी इसे हल किया है? –

उत्तर

0

पुस्तकालय Maven भंडार में है, इसलिए आप Maven केंद्रीय भंडार की घोषणा करने की जरूरत है संलग्न करें। यह अपनी परियोजना में इस तरह build.gradle फ़ाइल जोड़ें:

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.1.2' 
     classpath 'com.github.dcendents:android-maven-plugin:1.2' 
     classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1" 

    } 
} 
-1

कृपया निम्न देखें: इस बिंदु पर

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

, आप अपने स्थानीय में की जरूरत है। गुण फ़ाइलों में शामिल हों,

Bintray. User = XXX 
Bintray apikey = XXX 
संबंधित मुद्दे