Error: Configuration with name 'default' not found in Android Studio

前端 未结 11 1880
时光说笑
时光说笑 2020-11-27 15:03

I am using the volley library to perform network operation in android. So I am trying to add this library in my project which is created in Android Studio and gradle system

11条回答
  •  误落风尘
    2020-11-27 15:40

    For me, (as per some comments I have seen), the issue was that gradle could not find the build.gradle for the imported library. This configuration is straight-forward but the error message is a bit cryptic. For instance I was using the android-map-utils project and had to include it in my settings.gradle by appending these 2 lines like this.

    include ':android-map-utils'
    project(':android-map-utils').projectDir = new File(settingsDir, '..\\..\\modules\\android-maps-utils-master\\library')
    

    Path of the library is relative to the my project's settings.gradle file. Then, I simply referenced it in my dependencies of my app's build.gradle file like this

    ...
    
        dependencies {
        ....
            compile project(':android-map-utils')
        ....
    
        }
    

    I recommend importing one module at a time, compiling and checking it.

提交回复
热议问题