2014-05-08 25 views
17

Vui lòng bất kỳ ai giúp tôi. Đây là lỗi: Lỗi: Không có tài sản đó: nexusUsername cho lớp: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployerTôi gặp phải lỗi lạ trên studio android

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

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

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.grad le

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

hiển thị mã số – meda

+0

Cụ thể của bạn, hiển thị các tệp 'build.gradle' của bạn. – myanimal

+0

@meda Vui lòng xem số – Asthme

Trả lời

45

Thư viện HoloColorPicker có nhiệm vụ gradle để tải lên kho Maven mà yêu cầu một số thuộc tính được thiết lập cho các môi trường gradle (thường là trong gradle.properties).

Giải pháp đơn giản nhất sẽ được xóa đi dòng build.gradle:

apply from: 'maven_push.gradle' 
+0

Phần nào cần được chuyển đến maven_push.gradle? Bạn có thể vui lòng chỉ định? Cảm ơn bạn. – buggydroid

+0

có .. làm việc .. nhưng bạn có thể giải thích lý do? –

9

tôi đã không cố gắng giải pháp được đưa ra bởi myanimal, nhưng tôi có cố gắng ra một điều mà làm việc với tất cả các dự án có vấn đề tương tự trong khi nhập nó. giải pháp của myanimal chỉ liên quan đến một dự án, và đối với mỗi dự án bạn phải làm theo cùng một điều.

Nhưng với giải pháp của tôi, bạn có thể phải làm điều đó chỉ một lần cho tất cả các dự án trong tương lai.

Đối với giải pháp của tôi làm như dưới đây:

- tạo ra một tập tin ~/.gradle/gradle.properties với các nội dung sau:

nexusUsername= 
nexusPassword= 

Hy vọng điều này sẽ giúp bạn nhiều hơn cho tất cả các dự án .

+0

Đây là câu trả lời hay nhất. Câu trả lời này phải là câu trả lời được chấp nhận. –

+1

Câu trả lời này hoạt động như được đề cập trên github https://github.com/umano/AndroidSlidingUpPanel/issues/188 – mrroboaat

+0

Cảm ơn bạn. đơn giản và nhanh chóng – partiz

Các vấn đề liên quan