3

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'
}
Zoe
  • 27,060
  • 21
  • 118
  • 148

3 Answers3

2

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
1

Create a call like

@GlideModule
public final class GlideLoader extends AppGlideModule{


 }

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

Zuwa
  • 11
  • 4
0

You need to add the annotationProcessor dependency:

annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'

You also need to add an AppGlideModule. See the generated API documentation for details.

Agustín Clemente
  • 1,178
  • 3
  • 13
  • 23