android - gradle文件中 'com.android.support:appcompat-v7.27.1.1'的问题

标签 android gradle dependencies

这是我的依赖文件,编译 'com.android.support:appcompat-v7.27.1.1' 上有带下划线的红色文本

apply plugin: 'com.android.application'
 android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.abc.mcaproject"
    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'])


compile 'com.android.support:appcompat-v7.27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-storage:11.6.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'
}

apply plugin: 'com.google.gms.google-services'

因此,我在更改 styles.xml 中的主题时遇到问题

最佳答案

当您将鼠标悬停在红线上时,它可能会向您显示我在下面附加的图像。 Click to see the image

它告诉您某些库中存在版本冲突,因此它建议我们添加这些库。对于我的情况,首先显示 CardView,然后显示 Design。所以我添加了它。下面是它的代码。

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.0'
    implementation 'com.payumoney.sdkui:plug-n-play:1.2.0'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.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'
}

所以请添加那些它可能是 2 或更多。 希望对您有所帮助。

关于android - gradle文件中 'com.android.support:appcompat-v7.27.1.1'的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50134196/

相关文章:

android - 需要 android.support.v4.app.fragment

android - 为什么用android studio生成签名apk总是出错,apk可以调试运行

android - 将pcm编码为aac时,OMX.google.aac.encoder在MediaCodec中不起作用

node.js - 为什么 npm 坚持使用 "UNMET PEER DEPENDENCY"?

.net - 如何在仅更改依赖项的情况下运行相同的测试方法?

android - 当 ScaleType 为矩阵时,如何将图像设置为与父级对齐

gradle - 如何将Flyway升级到4.0

java - Spring Boot异常: java. lang.NoSuchMethodError : StandardJarScanner. setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)V

c++ - Android Studio Gradle如何编译外部cpp源?

java - 如何在 OSGi 中使用 Apache POI