이름이 ‘default’인 Android Studio Gradle 구성을 찾을 수 없습니다 포함 된 2 개의 라이브러리를

Android Studio (0.1.5)로 앱을 컴파일하는 데 문제가 있습니다. 응용 프로그램은 다음과 같이 포함 된 2 개의 라이브러리를 사용합니다.

settings.gradle

include ':myapp',':library',':android-ColorPickerPreference'

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}
apply plugin: 'android'

dependencies {
    compile files('libs/android-support-v4.jar')
    compile project(':library')
    compile project(':android-ColorPickerPreference')

}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

컴파일 할 때이 메시지가 나타납니다.

  Gradle: A problem occurred configuring project ':myapp'.
   > Failed to notify project evaluation listener.
   > Configuration with name 'default' not found.

이 메시지를 좀 도와 주시겠습니까? 감사!



답변

내 경우에는로 컴파일 한 후 gradle tasks --info로그가있었습니다.

빈 빌드 파일을 사용하여 프로젝트 ‘: libraries : VolleyLibrary’를 평가 중입니다.

그래서 라이브러리의 build.gradle 파일을 찾지 못했습니다. 이유는 폴더 구조입니다.

그것은이었다

-libraries
--volley
---VolleyLibrary

되어야한다

-libraries
--VolleyLibrary


답변

모든 하위 모듈을 가져 오는 것을 잊었습니다. 그래서 나의

compile project(':something')

해결할 수 없습니다.

해결책

git submodule update --init


답변

compile fileTree(dir: '//you libraries location//', include: ['android-ColorPickerPreference'])

앱의 gradle 파일 에서 위의 줄을 대신 사용하십시오.

compile project(':android-ColorPickerPreference')

그것이 도움이되기를 바랍니다.


답변

다음 절차에 따라 문제가 해결되었습니다.

  • 하위 프로젝트 모듈 / 라이브러리 모듈 설정으로 이동하십시오. (프레스F4 모듈을 후 )
  • 추가> Android-Gradle을 마우스 오른쪽 단추로 클릭하십시오 .
  • 모듈에 build.gradle을 추가하십시오.
  • 다음 스크립트를 추가하십시오

    buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
     }
    
    
      apply plugin: 'android-library'
    
    repositories {
    mavenCentral()
    }
    
    android {
    compileSdkVersion 18
    buildToolsVersion "18.1.0"
    
    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 18
    }
    
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    
    }
       } 
    1. include ':yourModuleName'설정에 추가 하십시오.

답변

나는 또한이 오류에 직면했습니다-라이브러리 프로젝트 용 build.gradle 스크립트를 만드는 것을 잊었습니다.


답변

또 다른 원인-settings.gradle을 사용하여 모듈을 포함하려고했습니다.

include ':MyModule'
project(':MyModule').projectDir = new File(settingsDir, '../../MyModule')

단지 문제는 방금 Eclipse에서 모듈을 가져 와서 디렉토리를 내 응용 프로그램 프로젝트 밖으로 옮기는 것을 잊어 버렸습니다. 즉, 경로 '../../MyModule'가 존재하지 않았습니다.


답변

내 해결책은 settings.gradle 파일에서 존재하지 않는 모듈을 나타내는 행을 간단히 제거하는 것입니다.

include ':somesdk'

기본 프로젝트의 build.gradle에서 해당 줄을 제거하십시오.

compile project(':somesdk')