She*_*uni 12 android gradle android-support-library google-play-services
我正在开发一款新应用.目前我正在尝试添加依赖项.
implementation 'com.google.android.gms:play-services:11.0.1'
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我在实现'com.android.support:appcompat-v7:27.1.1'上得到一个gradle编译错误说:
所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃).发现版本27.1.1,26.1.0.示例包括com.android.support:animated-vector-drawable:27.1.1和com.android.support:mediarouter-v7:26.1.0
任何想法如何最好地解决这个问题?
Gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.boulbabazitouni.getdevicelocation_time"
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.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.google.android.gms:play-services:11.0.1'
}
Run Code Online (Sandbox Code Playgroud)
问题是你在这个库中有一些瞬态依赖.每当发生这种情况时,您可以显式添加冲突的依赖项并将它们与当前版本匹配:
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3873 次 |
| 最近记录: |