我现在用的凌空库中的Android进行网络操作。所以,我想加入这个库中,在Android的Studio和摇篮系统创建我的项目。
我添加了凌空库在我的项目,但是当我用摇篮同步,然后我收到错误信息。我尝试了所有我在这里看到的答案,但没有为我工作。
错误信息:配置名为默认的机器人工作室找不到
排球/ build.gradle
应用插件:机器人库
安卓{
compileSdkVersion 19
buildToolsVersion '19 .0.1
sourceSets {
defaultConfig {
的minSdkVersion 8
targetSdkVersion 19
}
主要 {
assets.srcDirs = ['资产']
res.srcDirs = ['水库']
aidl.srcDirs = ['src'中]
resources.srcDirs = ['src'中]
renderscript.srcDirs = ['src'中]
java.srcDirs = ['src'中]
manifest.srcFile的AndroidManifest.xml
}
}
}
应用程序/ build.gradle
应用插件:'机器人'
安卓{
compileSdkVersion 19
buildToolsVersion '19 .0.1
defaultConfig {
的minSdkVersion 8
targetSdkVersion 19
版本code 1
VERSIONNAME1.0
}
buildTypes {
推出 {
runProguard假
proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'ProGuard的-rules.txt
}
}
}
依赖{
编译com.android.support:appcompat-v7:19.+
编制项目(':库:排)
}
根/ build.gradle
//顶级构建文件,你可以到各子项目/模块添加常用的配置选项。
buildscript {
库{
mavenCentral()
}
依赖{
类路径com.android.tools.build:gradle:0.9.1
}
}
allprojects {
库{
mavenCentral()
}
}
settings.gradle
包括:应用程序
包括:图书馆:凌空
解决方案
添加您的库文件夹在你的项目的根位置,并复制所有的库文件存在。对于前YourProject /库,然后将其同步和休息的东西似乎确定了我。
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.
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.
Error message : Configuration with name 'default' not found in Android Studio
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
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
// 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
include ':app'
include ':library:volley'
解决方案
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.