在将room组件添加到gradle配置文件后,编译项目出错,错误为“找不到符号类GlideApp”。如果注释掉“annotation processor "android.arch.persistence.room:compiler:$room_version"”,则项目可以无误地编译。有什么想法吗?
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.otpuskarche.onleave"
minSdkVersion 24
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 {
def room_version = "1.1.1"
def archLifecycleVersion = '1.1.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.3'
implementation 'com.android.support:support-v4:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
// Room components
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
androidTestImplementation "android.arch.persistence.room:testing:$room_version"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$archLifecycleVersion"
testImplementation 'junit:junit:4.12'
}
**
,并在**annotationProcessor
前后返回翻译文本。 - Manohar