android - 将 Android Studio 从 2.3.3 更新到 3.2。错误
问题描述
我最近将我的 Android Studio 从 2.3.3 更新到 3.2,但不幸的是已经两天了,我正在尝试修复错误,但我解决的最多,但我的项目中仍然存在一些问题:
gradle build 不断向我显示有关 Kotlin 版本的错误:
Android Gradle 插件仅支持 Kotlin Gradle 插件版本 1.2.51 及更高版本。项目“XXX”正在使用版本 1.1.4-3。
=> 问题是我的 kotlin 被声明为自动更新版本:
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
我不知道在哪里可以更改他们提到的版本。
此行代码始终带有红色下划线:
implementation 'com.android.support:appcompat-v7:28.0.0'
构建工具版本为 28.0.2
声明的错误是:
所有 com.android.support 库必须使用完全相同的版本规范。
PS:我用的 28.0.0 都是 com.android.support 库。
如果您对这两个问题有任何解决方案,请告诉我。
先感谢您。
这是我的构建文件
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.firebase.firebase-crash'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.ameerhamza6733.directmessagesaveandrepost"
minSdkVersion 17
targetSdkVersion 28
versionCode 32
versionName "1.0.32"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation project(':easy_sharedpreference_library')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.lolucosmin:PermissionsWrapper:version_1.2'
implementation 'com.artjimlop:altex-image-downloader:0.0.4'
implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.webianks.library:easy-feedback:1.0.2'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
testImplementation 'junit:junit:4.12'
implementation project(':library')
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
google()
}
解决方案
gradle build 不断向我显示有关 Kotlin 版本的错误:
回答
打开你的项目级build.gradle 文件,
在那里你会找到一个名为
buildscript
.转到该块并查找是否有一个名为的变量
ext.kotlin_version
将其更改为最新版本的Kotlin插件。
所有 com.android.support 库必须使用完全相同的版本规范。
问题在于您使用的库easy-feedback的支持库(v25)版本与您使用的(v28) 不同。
解决方案是从该依赖项中排除您的支持库,如下所示:
implementation ('com.webianks.library:easy-feedback:1.0.2', {
exclude group: 'com.android.support'
})
注意:如果问题仍然存在,请检查其他 3rd 方依赖项。
推荐阅读
- java - 什么是不使用 sun 类的观感主题?
- java - 为什么顺序文件命名不起作用?
- python - 无法通过套接字将泡菜对象从 linux 发送到 windows
- python - 如何在不编写新商店的情况下重命名 Zarr 数组?
- python - 在 Windows 上使用 Psutil 跟踪应用程序使用情况
- c - Mikroe RS485 Click with Azure Sphere - 使用 RS485 发送和接收字节数组
- python - MongoDB 聚合以在字段之间进行选择
- php - 当表单提交中项目的类别发生变化时,在 foreach 循环中添加标题
- android - 您好,我如何与 Kotlin 共享使用来自 android studio 的 PdfDocument 生成的 PDF 文件
- android - 图像视图未剪辑在具有可绘制形状背景的约束布局内