首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android支持库必须使用完全相同的版本吗?

android支持库必须使用完全相同的版本吗?
EN

Stack Overflow用户
提问于 2018-09-01 14:14:09
回答 1查看 408关注 0票数 0

我试图导入以下库:

代码语言:javascript
复制
    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'

但是,当我同步时,我会得到以下错误:

所有com.android.support库都必须使用完全相同的版本规范(混合版本会导致运行时崩溃)。找到28.0.0-rc01 01,27.1.0版本。示例包括com.android.support:animated-vector-drawable:28.0.0-rc01和com.android.Support:exifinterface:27.1.0.

我试着添加以下内容,但没有任何帮助。我该怎么解决这个问题?

代码语言:javascript
复制
implementation 'com.android.support:exifinterface-28.0.0-rc01'
EN

回答 1

Stack Overflow用户

发布于 2018-09-01 17:57:45

确保将compileSdkVersion 28targetSdkVersion 28放在build.gradle文件中的android块中。

还要确保在依赖项块中有appcompat-v7:28.0.0-rc01

那么我认为可以在没有任何问题的情况下添加implementation 'com.android.support:exifinterface:28.0.0-rc01'

我正在粘贴我的build.gradle (模块:app),以供参考。

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.chirag.example.retrofeitdemo"
        minSdkVersion 15
        targetSdkVersion 28
        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(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    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:exifinterface:28.0.0-rc01'
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52128924

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档