이름이 'default'인 구성을 찾을 수 없습니다. 안드로이드 스튜디오
Android Studio 앱이 있습니다. 라이브러리 종속성 (Android-Bootstrap)이 있으며 gradle을 동기화하려고하면 오류가 발생합니다.
이름이 'default'인 구성을 찾을 수 없습니다.
내 구조는 다음과 같습니다.
-FTPBackup
-fotobackup
-build.gradle
-Libraries
-Android-Bootstrap
-Settings.gradle
-build.gradle
-Settings.gradle
-Build.gradle
FTPBackup settings.gradle 및 build.gradle :
include ':fotobackup'
include ':libraries:Android-Bootstrap',':Android-Bootstrap'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
fotobackup 내부의 build.gradle은 다음과 같습니다.
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:+'
compile project (':libraries:Android-Bootstrap')
}
라이브러리는 https://github.com/Bearded-Hen/Android-Bootstrap 에서 다운로드되며 build.gradle, 설정 등이 있습니다.
뭐가 문제 야?
하나의 경우 settings.gradle 파일 이 두 개 이상있는 것은 좋지 않습니다 . 최상위 파일 만 확인합니다.
이 "Configuration with name 'default'not found"오류가 발생하면 정말 혼란 스럽지만 Gradle이 어딘가에서 모듈 (또는 build.gradle) 파일을 찾고 있지만 찾지 못한다는 의미입니다. 귀하의 경우 settings.gradle 파일에 다음 이 있습니다.
include ':libraries:Android-Bootstrap',':Android-Bootstrap'
which is making Gradle look for a library at FTPBackup/libraries/Android-Bootstrap. If you're on a case-sensitive filesystem (and you haven't mistyped Libraries in your question when you meant libraries), it may not find FTPBackup/Libraries/Android-Bootstrap because of the case difference. It's also looking for another library at FTPBackup/Android-Bootstrap, and it's definitely not going to find one because that directory isn't there.
This should work:
include ':Libraries:Android-Bootstrap'
You need the same case-sensitive spec in your dependencies block:
compile project (':Libraries:Android-Bootstrap')
compile fileTree(dir: 'libraries', include: ['Android-Bootstrap'])
Use above line in your app's gradle file instead of
compile project (':libraries:Android-Bootstrap')
In my setting.gradle, I included a module that does not exist. Once I removed it, it started working. This could be another way to fix this issue
If you're getting this error with react native, it may be due to a link to an NPM package that you removed (as it was in my case). After removing references to it in the settings.gradle and build.gradle files, I cleaned and rebuilt and it's as good as new :)
Just a note on this question:
I had this exact error in my React Native app when trying to build to android. All you should have to do is $ npm i.
Case matters I manually added a submodule :k3b-geohelper to the settings.gradle file
include ':app', ':k3b-geohelper'
and everthing works fine on my mswindows build system
When i pushed the update to github the fdroid build system failed with
Cannot evaluate module k3b-geohelper : Configuration with name 'default' not found
The final solution was that the submodule folder was named k3b-geoHelper not k3b-geohelper.
Under MSWindows case doesn-t matter but on linux system it does
I had this issue with Jenkins. The cause: I had renamed a module module to Module. I found out that git had gotten confused somehow and kept both module and Module directories, with the contents spread between both folders. The build.gradle was kept in module but the module's name was Module so it was unable to find the default configuration.
I fixed it by backing up the contents of Module, manually deleting module folder from the repo and restoring + pushing the lost files.
I also faced the same problem and the problem was that the libraries were missing in some of the following files.
settings.gradle, app/build.gradle, package.json, MainApplication.java
Suppose the library is react-native-vector-icons then it should be mentioned in following files;
In app/build.gradle file under dependencies section add:
compile project(':react-native-vector-icons')
In settings.gradle file under android folder, add the following:
include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
In MainApplication.java, add the following:
Import the dependency: import com.oblador.vectoricons.VectorIconsPackage;
and then add: new VectorIconsPackage() in getPackages() method.
I am facing same problem, I was fixed it by generating gradle project and then adding lib project to android studio
First, See build.gradle file is present in project root directory
if not then, Create gradle project,
- export your required lib project from eclipse then (File->Export->Android->generate Gradle build file
- Click on Next->Next->Select your lib project from project listing->Next->Next->Finish
- See build.gradle file present in your project root directory
- Move this project to Android Studio
Your module name must be camelCase eg. pdfLib. I had same issue because I my module name was 'PdfLib' and after renaming it to 'pdfLib'. It worked. The issue was not in my device but in jenkins server. So, check and see if you have such modulenames
Step.1 $ git submodule update
Step.2 To be commented out the dependences of classpass
The message is a known Gradle bug. The reason of your error is that some of your gradle.build files has no apply plugin: 'java' in it. And due to the bug Gradle doesn't say you, where is the problem.
But you can easily overcome it. Simply put apply plugin: 'java' in every your 'gradle.build'
You are better off running the command in the console to get a better idea on what is wrong with the settings. In my case, when I ran gradlew check it actually tells me which referenced project was missing.
* What went wrong:
Could not determine the dependencies of task ':test'.
Could not resolve all task dependencies for configuration ':testRuntimeClasspath'.
Could not resolve project :lib-blah.
Required by:
project :
> Unable to find a matching configuration of project :lib-blah: None of the consumable configurations have attributes.
The annoying thing was that, it would not show any meaningful error message during the import failure. And if I commented out all the project references, sure it let me import it, but then once I uncomment it out, it would only print that ambiguous message and not tell you what is wrong.
'IT TIP' 카테고리의 다른 글
| 알 수없는 Tomcat 버전이 tomcat-7.0.42로 지정되었습니다. (0) | 2020.11.23 |
|---|---|
| 컨트롤러에서 $ inject 사용을 이해하지 못합니다. (0) | 2020.11.23 |
| android.support.v7.widget.Toolbar 클래스를 확장하는 중에 오류가 발생 했습니까? (0) | 2020.11.23 |
| 컴파일러가 char에 대해 varargs char 오버로드보다 int 오버로드를 선호하는 이유는 무엇입니까? (0) | 2020.11.23 |
| com.google.android.gms.internal.zzaja의 클래스 파일을 찾을 수 없습니다. (0) | 2020.11.23 |