No such property: sonatypeUserName for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

后端 未结 6 1178
遇见更好的自我
遇见更好的自我 2020-12-14 10:10

I\'m trying to use this blibioteca android-maps-extensions because I need to fix more than 1000 markers on my map .

Added the project dependencies in my project :

相关标签:
6条回答
  • 2020-12-14 10:39

    Also, if other suggestions didn't fix the problem, you can try to re-write your lib's build.gradle as usual build.gradle file. More likely its not a good idea, but it worked for me properly:

    apply plugin: 'android'
    
    version = "1.0.1"
    group = "com.edmodo"
    
    android {
    
        compileSdkVersion 21
        buildToolsVersion "21.1.2"
    
        defaultConfig {
            minSdkVersion 7
            targetSdkVersion 21
        }
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                res.srcDirs = ['res']
            }
        }
    }
    
    0 讨论(0)
  • 2020-12-14 10:43

    I believe This line shows error:

    authentication(userName: ossrhUsername, password: ossrhPassword)

    Replace it with:

    authentication(userName: hasProperty('ossrhUsername')?ossrhUsername:'', password: hasProperty('ossrhPassword')?ossrhPassword:'')

    0 讨论(0)
  • 2020-12-14 10:52

    modify your gradle.properties file:

    #To fix compile error. 
    sonatypeRepo=null  
    sonatypeUsername=null  
    sonatypePassword=null 
    
    0 讨论(0)
  • 2020-12-14 10:53

    Open the gradle.properties file inside the projects android-maps-utils-master that you may have downloaded from GitHub

    You will find

    version=0.4-SNAPSHOT
    
    # variables required to allow build.gradle to parse,
    # override in ~/.gradle/gradle.properties
    signing.keyId=
    signing.password=
    signing.secretKeyRingFile=
    
    sonatypeUsername=
    sonatypePassword=
    

    inside it, just copy and put it in your projects gradle.properties.

    0 讨论(0)
  • 2020-12-14 10:55

    I encountered the same error

    No such property : for class sonatypeUserName : org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

    What I did to fix the problem was I just copy pasted 'sonatypeUserName' in the gradle.properties

    0 讨论(0)
  • 2020-12-14 10:56

    When using gradle, you don't normally copy the project into your own, but instead just add dependency like this:

    dependencies {
        // your other dependencies
        compile 'com.androidmapsextensions:android-maps-extensions:2.1.+';
        compile 'com.google.android.gms:play-services:4.1.+'
    }
    

    To see the latest versions of libraries, you may use Gradle, please.

    But if you want to use the project directly, you also need to have gradle.properties with variables defined:

    sonatypeUserName=
    sonatypePassword=
    
    0 讨论(0)
提交回复
热议问题