gpt4 book ai didi

Android Appcompat-v7 错误

转载 作者:搜寻专家 更新时间:2023-11-01 08:27:22 24 4
gpt4 key购买 nike

我正在使用 android studio 2.3.1,在 android build.gradle 中

compile 'com.android.support:appcompat-v7:23.4.0'

有错误

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 24.0.0, 23.4.0. Examples include com.android.support:support-v4:24.0.0 and com.android.support:animated-vector-drawable:23.4.0

这是我的build.gradle

apply plugin: 'com.android.application'   

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.wsolus.chathuranga.simplifya"
minSdkVersion 16
targetSdkVersion 23
versionCode 22
versionName "2.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
} } dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient"
}
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'

}

请帮帮我谢谢

这是 gradle 的屏幕截图:

This is a screen shot of the gradle

最佳答案

像这样更改你的 gradle 文件,然后转到 file->Invalidate cache and restart

apply plugin: 'com.android.application'   

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.wsolus.chathuranga.simplifya"
minSdkVersion 16
targetSdkVersion 23
versionCode 22
versionName "2.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
} } dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient"
}
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:palette-v7:24.2.0'

}

关于Android Appcompat-v7 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43485981/

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