Configuration with name 'default' not found. Android Studio

后端 未结 13 1755
独厮守ぢ
独厮守ぢ 2020-11-27 05:44

I have an Android Studio app. It has a library dependency (Android-Bootstrap), when I try to sync gradle, it gives me an error:

Configuration with nam

相关标签:
13条回答
  • 2020-11-27 06:17

    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'

    0 讨论(0)
  • 2020-11-27 06:17

    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,

    1. export your required lib project from eclipse then (File->Export->Android->generate Gradle build file
    2. Click on Next->Next->Select your lib project from project listing->Next->Next->Finish
    3. See build.gradle file present in your project root directory
    4. Move this project to Android Studio
    0 讨论(0)
  • 2020-11-27 06:20

    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

    0 讨论(0)
  • 2020-11-27 06:24

    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.

    0 讨论(0)
  • 2020-11-27 06:25

    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.

    0 讨论(0)
  • 2020-11-27 06:27
    compile fileTree(dir: 'libraries', include: ['Android-Bootstrap'])
    

    Use above line in your app's gradle file instead of

    compile project (':libraries:Android-Bootstrap')
    
    0 讨论(0)
提交回复
热议问题