Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find GlideApp after adding the Room compiler

compile project failed with error "cannot find symbol class GlideApp" after added room components to the gradle config file. Project compile without error if comment out "annotation processor "android.arch.persistence.room:compiler:$room_version". Any ideas?

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'
}
like image 938
Ivan Penkov Avatar asked Dec 12 '25 17:12

Ivan Penkov


2 Answers

The problem was with room. The schema export directory was not set. Build log feint me as the error appeared on the bottom of the log.

reference to real issue - room-schema-export

like image 129
Ivan Penkov Avatar answered Dec 15 '25 09:12

Ivan Penkov


Create a call like

@GlideModule
public final class GlideLoader extends AppGlideModule{


 }

And Build Project.Then You will access glide by GlideApp.

like image 43
Zuwa Avatar answered Dec 15 '25 10:12

Zuwa