无法获得凭据的未知属性“ mavenUser”

Yod*_*lov 4 android android-gradle-plugin

我在Android Studio 中的build.gradle中遇到以下所有错误:

Could not get unknown property 'mavenUser' for Credentials
        [username: null] of type
org.gradle.api.internal.artifacts.repositories.DefaultPasswordCredentials_Decorated
Run Code Online (Sandbox Code Playgroud)

在我的Gradle文件下面:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'

        repositories {
            mavenCentral()
            maven {


                // ~/.gradle/gradle.properties should be configured!
                credentials {
                    username mavenUser
                    password mavenPassword
                }
                url 'http://dev.softwerk.se:8080/nexus/content/repositories/softwerk-repo'
            }
        }

        android {
            compileSdkVersion 19
            buildToolsVersion "19.0.1"

            defaultConfig {
                minSdkVersion 8
                targetSdkVersion 19
                versionCode 2014020601
                versionName "2.0.0"
            }

            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_7
                targetCompatibility JavaVersion.VERSION_1_7
            }
        }

        dependencies {
            compile 'com.android.support:support-v4:19.0.+'
            compile 'com.android.support:appcompat-v7:19.0.+'
            compile 'com.google.android.gms:play-services:4.0.30'

            // Sync framework
            compile 'se.softwerk.commons.android:android-framework:1.1.10@aar'
            compile 'com.googlecode.plist:dd-plist:1.0'
            compile 'com.google.code.gson:gson:1.7.1'
            compile 'commons-io:commons-io:2.1'
        }
    }
}`
Run Code Online (Sandbox Code Playgroud)

rm8*_*m8x 6

gradle.properties在项目目录中创建一个名为的文件。添加行:

mavenUser=yourusername
mavenPassword=yourpassword
Run Code Online (Sandbox Code Playgroud)

  • 在存储库中发布您的密码看起来不是一个安全的选择 (2认同)