我该怎么做才能解决这个问题?当我在android studio0.9.1中运行我的项目时,我收到此错误
android {compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.nearby"
minSdkVersion 11
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}}dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:19.0.0'
compile files('libs/google-play-services.jar')}
Run Code Online (Sandbox Code Playgroud)
Ion*_*ham 107
我刚遇到同样的错误.确保android项目的顶级build.gradle中没有块,仅在模块的build.gradle文件中.
当AndroidStudio尝试导入现有的,可构建的Eclipse/ADT项目时,我发生了这种情况 - 我不得不将android块从一个gradle文件剪切并粘贴到另一个gradle文件中.我不知道这是否已在更新版本的AndroidStudio中得到修复.
受到Ionoclast Brigham的回答的启发,我检查了两个gradle文件.我在他们两个中都有android()...但是我没有将android()从根目录移动到我刚刚添加的模块一
apply plugin: 'android'
Run Code Online (Sandbox Code Playgroud)
root一个并且构建工作正常.
| 归档时间: |
|
| 查看次数: |
44368 次 |
| 最近记录: |