错误:在 Android Studio 中找不到名称为“默认"

Error: Configuration with name #39;default#39; not found in Android Studio(错误:在 Android Studio 中找不到名称为“默认的配置)
本文介绍了错误:在 Android Studio 中找不到名称为“默认"的配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 volley 库在 android 中执行网络操作.所以我试图在我的项目中添加这个库,它是在 Android Studio 和 gradle 系统中创建的.

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.

我在我的项目中添加了 volley 库,但是当我与 gradle 同步时,我收到了错误消息.我尝试了我在这里看到的所有答案,但对我没有任何帮助.

I added the volley library in my project but when I sync with gradle then I am getting error message. I tried all the answers which I see here but nothing worked for me.

错误消息:在 Android Studio 中找不到名为默认"的配置

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

Volley/build.gradle

Volley/build.gradle

apply plugin: 'android-library'

android {

    compileSdkVersion 19
    buildToolsVersion '19.0.1'

    sourceSets {
        defaultConfig {
            minSdkVersion 8
            targetSdkVersion 19
        }

        main {
            assets.srcDirs       = ['assets']
            res.srcDirs          = ['res']
            aidl.srcDirs         = ['src']
            resources.srcDirs    = ['src']
            renderscript.srcDirs = ['src']
            java.srcDirs         = ['src']
            manifest.srcFile 'AndroidManifest.xml'

        }
    }
}

app/build.gradle

app/build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.1'

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:19.+'
    compile project(':library:volley')
}

root/build.gradle

root/build.gradle

// 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.1'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

settings.gradle

settings.gradle

include ':app'
include ':library:volley'

推荐答案

在项目的根目录中添加库文件夹,并将所有库文件复制到那里.对于 ex YourProject/library 然后同步它,其余的东西对我来说似乎没问题.

Add your library folder in your root location of your project and copy all the library files there. For ex YourProject/library then sync it and rest things seems OK to me.

这篇关于错误:在 Android Studio 中找不到名称为“默认"的配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)