I want to use the new navigation library of android jetpack. As I wanted to add a navigation XML to my project I got an error saying:
This operation requires the libraries android.arch.navigation:navigation-fragment:+, android.arch.navigation:navigation-ui:+.
Problem: Inconsistencies in the existing project dependencies found. Version incompatibility between: - android.arch.persistence.room:runtime:1.1.1 and: - com.android.support:appcompat-v7:27.1.1
With the dependency: - com.android.support:support-annotations:26.1.0 versus: - com.android.support:support-annotations:27.1.1
The project may not compile after adding these libraries. Would you like to add them anyway?
I hit "cancel" since I didn't know what the consequences for my little project would be. Why is that happening? Is room not compatible with the navigation library? Do I risk that my project will not compile after adding those? Should I save the gradle file and just try?
I would be very grateful for clarification. Thank you:)
My gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "de.test"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
}