我正在尝试从github导入此项目应用程序,但是版本https://github.com/TechCybo/Android-App-From-Responsive-Website-NavDrawer
出了点问题我尝试了这篇文章,但没有任何帮助 Unsupported method: BaseConfig.getApplicationIdSuffix() >
Gradle同步失败:不支持的方法:BaseConfig.getApplicationIdSuffix()。 您连接到的Gradle版本不支持该方法。 要解决该问题,您可以更改/升级您连接到的Gradle的目标版本。 或者,您可以忽略此异常并从模型中读取其他信息。 (6 s 306 ms)
我的 BUILD.GRADLE
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
答案 0 :(得分:0)
这是一个旧项目,需要进行更新才能在当前的Android Studio版本上进行编译,并且可以在Play商店中发布。
我能够通过升级到Gradle 2.3.3和SDK版本25进行编译。
以下是差异:删除以-
减号开头的行,并添加以+
加号开头的行。您不需要添加/删除花括号。
build.gradle:
- classpath 'com.android.tools.build:gradle:1.3.0'
+ classpath 'com.android.tools.build:gradle:2.3.3'
进行上述更改后,构建项目。它会失败。现在,点击构建控制台上的Fix Gradle wrapper and reimport project
。然后按照下一个差异。
app / build.gradle:
android {
- compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ compileSdkVersion 25
+ buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.mywebsite.mywebsite"
minSdkVersion 14
- targetSdkVersion 23
+ targetSdkVersion 25
versionCode 1
versionName "1.0"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
- compile 'com.android.support:appcompat-v7:23.0.0'
- compile 'com.android.support:design:23.0.0'
+ compile 'com.android.support:appcompat-v7:25.0.0'
+ compile 'com.android.support:design:25.0.0'
}