作者:小张 | 来源:互联网 | 2023-05-21 18:08
在尝试运行最初在Eclipse ADT上创建的项目时,我遇到了这个问题.
Error:(17, 0) Gradle DSL method not found: 'compileSdkVersion()'
Possible causes:
- The project 'TaxiAndroidOpen-master' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
- The build file may be missing a Gradle plugin.
Apply Gradle plugin
我已将此转换为Android Studio gradle系统.
但我无法运行它,也无法编译它,因为这个错误,这里是生成的gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
ext {
compileSdkVersion 17
buildToolsVersion '18.1.0'
}
dependencies {
}
我在SO上发现了一些其他帖子,但有类似的错误,但没有人有这个特定的帖子.
我正在使用Android Studio 1.0.2,x86.
有人可以对此有所了解吗?
提前致谢!
编辑
更新了build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.opentaxi.android"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':comtaxibulgariamap_mapsforge_044201406271417533')
compile files('libs/littlefluffylocationlibrary_r15.jar')
}
Mohit Singh..
15
您的应用程序模块的build.gradle文件应如下所示.
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.opentaxi.android"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':comtaxibulgariamap_mapsforge_044201406271417533')
compile fileTree(include: ['*.jar'], dir: 'libs')
}
如果在发布时存在,则从主build.gradle(在应用程序的根目录中)中删除这些行.
ext {
compileSdkVersion 17
buildToolsVersion '18.1.0'
}
dependencies {
}
Bill Mote..
9
您最近是否升级到Android Studio 1.0?如果是这样,请在app/build.gradle中使用minifyEnabled替换runProguard.
1> Mohit Singh..:
您的应用程序模块的build.gradle文件应如下所示.
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.opentaxi.android"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':comtaxibulgariamap_mapsforge_044201406271417533')
compile fileTree(include: ['*.jar'], dir: 'libs')
}
如果在发布时存在,则从主build.gradle(在应用程序的根目录中)中删除这些行.
ext {
compileSdkVersion 17
buildToolsVersion '18.1.0'
}
dependencies {
}
2> Bill Mote..:
您最近是否升级到Android Studio 1.0?如果是这样,请在app/build.gradle中使用minifyEnabled替换runProguard.