gpt4 book ai didi

android - 无法从android studio上的github导入项目

转载 作者:行者123 更新时间:2023-12-03 05:38:26 25 4
gpt4 key购买 nike

我正在尝试从github导入此项目应用程序,但是https://github.com/TechCybo/Android-App-From-Responsive-Website-NavDrawer版本出了点问题

我尝试了这篇文章,但没有任何帮助
Unsupported method: BaseConfig.getApplicationIdSuffix()
>

Gradle sync failed: Unsupported method: BaseConfig.getApplicationIdSuffix(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you connect to. Alternatively, you can ignore this exception and read other information from the model. (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
}

最佳答案

这是一个旧项目,需要进行更新才能在当前的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'
}

关于android - 无法从android studio上的github导入项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54577994/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com