Could not resolve all dependencies for configuration ':app:_debugApk'. > Configuration with name 'default' not found.

Could not resolve all dependencies for configuration ‘:app:_debugApk’. > Configuration with name ‘default’ not found.

查看android项目结构下的gradle scripts 只有工程project项的build.gradle,并没有Module的build.gradle

解决方式:
1、删除app目录下其他的依赖项:
dependencies {
// compile project(‘:react-native-picker’)
// compile project(‘:react-native-image-crop-picker’)
// compile project(‘:react-native-vector-icons’)
compile fileTree(dir: “libs”, include: [“*.jar”])
compile “com.android.support:appcompat-v7:23.0.1”
compile “com.facebook.react:react-native:+” // From node_modules
}
2、找到settings.gradle,删除多余的依赖项,只保留
rootProject.name = ‘dong’
include ‘:app’
// include ‘:react-native-picker’
// project(‘:react-native-picker’).projectDir = new File(rootProject.projectDir, ‘../node_modules/react-native-picker/android’)
//project(‘:react-native-image-crop-picker’).projectDir = new File(rootProject.projectDir, ‘../node_modules/react-native-image-crop-picker/android’)
//include ‘:react-native-vector-icons’
//project(‘:react-native-vector-icons’).projectDir = new File(rootProject.projectDir, ‘../node_modules/react-native-vector-icons/android’)
3、重新gradle编译
4、添加依赖项,重新编译

    原文作者:DeanWan
    原文地址: https://www.jianshu.com/p/ae7a4819b9bf
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞