gpt4 book ai didi

android - 添加 Room 编译器后找不到 GlideApp

转载 作者:搜寻专家 更新时间:2023-11-01 09:24:34 26 4
gpt4 key购买 nike

在将房间组件添加到 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'
}

最佳答案

问题在于房间。未设置架构导出目录。构建日志欺骗我,因为错误出现在日志的底部。

引用实际问题 - room-schema-export

关于android - 添加 Room 编译器后找不到 GlideApp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51653629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com