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

前端 未结 11 1881
时光说笑
时光说笑 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:34

    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.

提交回复
热议问题