我使用过Android Studio 3.0 Beta 2中有以下gradle这个设置客房持久性库:无法解析
我可以搜索RxRoom但目前没有房类。按照指令Add Components,我不能在我的Fragment中使用Room类。
该课程在单独模块中,应用程序模块不包含任何房间库依赖项。
错误在IDE中显示“无法解析符号空间”。
的build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":
"$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:recyclerview-v7:26.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "android.arch.persistence.room:runtime:1.0.0-alpha9"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha9"
testImplementation "android.arch.persistence.room:testing:1.0.0-alpha9"
implementation "android.arch.persistence.room:rxjava2:1.0.0-alpha9"
}
更新 我已经试过了房间图书馆第一降级到alpha8和客房类现在回来了。我不知道为什么这个类在alpha9中消失了,但至少它是解决方法。
我改变了运行时间和rxjava2是 “API”,但没有运气 –