【问题标题】:implementation 'com.android.support:appcompat-v7:27.1.1' failed实施 'com.android.support:appcompat-v7:27.1.1' 失败
【发布时间】:2018-06-23 05:36:12
【问题描述】:

所以,我在运行 Android 项目时遇到了问题。据说 那个

所有 com.android.support 库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。成立 版本 27.1.1、26.1.0。例子包括 com.android.support:animated-vector-drawable:27.1.1 和 com.android.support:support-media-compat:26.1.0

我在 .\idea\libraries 中找到了一个文件 >>>>> com_android_support_support_media_compat_26_1_0

我曾尝试将 com.android.support:support-media-compat:26.1.0 的文件删除或重命名为 27.1.1,但失败了。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.sbyparking.car.surabayaparking"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:gridlayout-v7:27.1.1'
}

你们有什么想法我该怎么做吗?因为我是 Android Studio 的新手。 提前致谢

【问题讨论】:

  • 我遇到了同样的问题,所以我临时做了//noinspection GradleCompatible implementation 'com.android.support:support-compat:27.1.1'

标签: android android-studio


【解决方案1】:

第一种解决方案:

  • 检查离线模式是打开还是关闭,如果打开,请关闭。

  • 现在继续 Tools>SDK Manager>Open one Dialog in this Dialog 选择 SDK Platform 并勾选 Android 7.1.1(Nougat) 并下载。

现在继续:File & Select Sync Project with Gradle Files

以上解决方案适合您。


第二个解决方案:

如果您想implementation 'com.android.support:appcompat-v7:26.1.0',请按照以下步骤操作:

改变:

compileSdkVersion 27compileSdkVersion 26

minSdkVersion 21minSdkVersion 15

targetSdkVersion 27targetSdkVersion 26

终于改变了:

implementation 'com.android.support:appcompat-v7:27.1.1'

implementation 'com.android.support:appcompat-v7:26.1.0'

现在继续:File & Select Sync Project with Gradle Files

  • Clean & Rebuild Project

【讨论】:

    猜你喜欢
    • 2019-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-04
    • 1970-01-01
    相关资源
    最近更新 更多