简体   繁体   English

我在android studio上遇到了奇怪的错误

[英]I am getting strange error on android studio

Please any one help me. 请任何人帮助我。 This is the error: Error:No such property: nexusUsername for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer 这是错误:错误:没有这样的属性:类的nexusUsername:org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

stacktrace 堆栈跟踪

Information:Gradle tasks [:app:compileDebugJava]
Information:FAILURE: Build failed with an exception.
Information:* What went wrong:
Information:A problem occurred configuring project ':app'.
Information:> A problem occurred configuring project':libraries:HoloColorPicker-    master'.
Information:   > No such property: nexusUsername for class:        org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
       Information:* Try:
          Information:Run with --stacktrace option to get the stack trace. Run with --info                       or --debug option to get more log output.
Information:0 errors

settings.gradle settings.gradle

include ':app'
include ':libraries:HoloColorPicker-master'

build.gradle 的build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.3'

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

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:19.+'
    compile project(':libraries:HoloColorPicker-master')
}

Holopicker build.gradle Holopicker build.gradle

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}

def isReleaseBuild() {
    return version.contains("SNAPSHOT") == false
}

allprojects {
    version = VERSION_NAME
    group = GROUP

    repositories {
        mavenCentral()
    }
}

apply plugin: 'android-library'
android {
    compileSdkVersion 19
    buildToolsVersion "18.1.1"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

apply from: 'maven_push.gradle'

The HoloColorPicker library has gradle tasks for uploading to the Maven repository that require some properties to be set for the gradle environment (usually in gradle.properties ). HoloColorPicker库具有用于上载到Maven存储库的gradle任务,需要为gradle环境设置一些属性(通常在gradle.properties )。

The easiest solution would be to remove the line from build.gradle : 最简单的解决方案是从build.gradle删除该行:

apply from: 'maven_push.gradle'

I have not try the solution given by myanimal, but i have try out another thing which works with all the project which have similar issue during importing it. 我没有尝试myanimal给出的解决方案,但我尝试了另一个适用于导入过程中具有类似问题的所有项目的东西。 myanimal's solution is related to only one project, and for every project you should have to follow same thing. myanimal的解决方案只与一个项目相关,对于每个项目,您都必须遵循同样的事情。

But with my solution you might have to do it only once for all future projects. 但是使用我的解决方案,您可能只需要为所有未来的项目执行一次。

For my solution do like below: 我的解决方案如下所示:

- create a file ~/.gradle/gradle.properties with the following contents: - 使用以下内容创建文件〜/ .gradle / gradle.properties:

 nexusUsername= nexusPassword= 

Hope this will help you more for all projects. 希望这对所有项目都有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在onAttach(Context)上遇到这个奇怪的错误 - I am getting this strange error on in onAttach(Context) 在Android Studio中遇到一些奇怪的错误-Gradle? - Getting some strange error in android studio - gradle? 我在android studio的Image View中遇到以下错误 - I am getting the following error in Image View in android studio 为什么我在使用 android studio 时会出现此错误。? - Why am I getting this error while using android studio.? 运行我的应用程序时,我在android studio中收到此错误 - I am getting this error in android studio while running my app 为什么在Android Studio中出现与主题相关的错误? - why am I getting an Theme related error in android studio? 为什么在Android Studio中的SearchView和OnQueryTextListener上出现此错误? - Why am I getting this error in Android Studio on SearchView and OnQueryTextListener? 在打开 Android Studio 时,我在正文中收到错误链接? - While Opening Android Studio I am getting Error Link in the body? 在 android 工作室中使用 CoordinatorTabLayout 时出现错误 - I am getting error while using CoordinatorTabLayout in android studio 我的Android Studio项目中出现以下错误 - I am getting following error in my Android Studio Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM