在我的Android项目中使用Realm数据库时无法生成GlideApp和Glide请求

问题描述 投票:2回答:1

我正在使用Glide拍摄图像,到现在为止一切正常。但是现在,当我将Realm数据库集成到我的项目中时,生成GlideApp和GlideRequests类产生了错误。

Main build.gradle

buildscript {

    repositories {
        mavenCentral()
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'io.realm:realm-gradle-plugin:5.8.0'
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()

        maven {
            url "https://raw.github.com/signalapp/maven/master/photoview/releases/"
        }
        maven {
            url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/"
        }
        maven {
            url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App build.gradle

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    flavorDimensions "none"
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.deskera.desk"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true

        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true
        project.ext.set("archivesBaseName", "DESK")

        ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "mips" }
    }

    buildTypes {
        debug {
            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-glide.pro',
                    'proguard.cfg'
        }
        release {
            minifyEnabled true
            proguardFiles = buildTypes.debug.proguardFiles
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions {
        exclude 'LICENSE.txt'
        exclude 'LICENSE'
        exclude 'NOTICE'
        exclude 'asm-license.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/proguard/androidx-annotations.pro'
    }
}

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'


    def supportVersion = '28.0.0'
    implementation "com.android.support:appcompat-v7:$supportVersion"
    implementation "com.android.support:recyclerview-v7:$supportVersion"
    implementation "com.android.support:design:$supportVersion"
    implementation "com.android.support:support-v13:$supportVersion"
    implementation "com.android.support:cardview-v7:$supportVersion"
    implementation "com.android.support:preference-v7:$supportVersion"
    implementation "com.android.support:preference-v14:$supportVersion"
    implementation "com.android.support:gridlayout-v7:$supportVersion"
    implementation "com.android.support:exifinterface:$supportVersion"

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'android.arch.lifecycle:extensions:1.1.1'
    implementation 'android.arch.lifecycle:common-java8:1.1.1'
    implementation 'android.arch.work:work-runtime:1.0.0-alpha11'

    implementation 'com.google.android.gms:play-services-gcm:9.6.1'
    implementation 'com.google.android.gms:play-services-maps:9.6.1'
    implementation 'com.google.android.gms:play-services-places:9.6.1'

    implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'

    implementation 'org.whispersystems:signal-service-android:2.12.2'
    implementation 'org.whispersystems:webrtc-android:M69'

    implementation "me.leolin:ShortcutBadger:1.1.16"
    implementation 'se.emilsjolander:stickylistheaders:2.7.0'
    implementation 'com.jpardogo.materialtabstrip:library:1.0.9'
    implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
    implementation 'com.github.chrisbanes:PhotoView:2.1.3'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'com.makeramen:roundedimageview:2.1.0'
    implementation 'com.pnikosis:materialish-progress:1.5'
    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'pl.tajchert:waitingdots:0.1.0'
    implementation 'com.soundcloud.android:android-crop:0.9.10@aar'
    implementation 'com.melnykov:floatingactionbutton:1.3.0'
    implementation 'com.google.zxing:android-integration:3.1.0'
    implementation 'com.squareup.dagger:dagger:1.2.2'
    annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
    implementation 'mobi.upod:time-duration-picker:1.1.3'
    compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    implementation 'com.google.zxing:core:3.2.1'
    implementation('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    implementation('cn.carbswang.android:NumberPickerView:1.0.9') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }
    implementation('com.tomergoldst.android:tooltips:1.0.6') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }
    implementation('com.klinkerapps:android-smsmms:4.0.1') {
        exclude group: 'com.squareup.okhttp', module: 'okhttp'
        exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
    }
    implementation 'com.annimon:stream:1.1.8'
    implementation('com.takisoft.fix:colorpicker:0.9.1') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
    implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
    implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
    implementation('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
        exclude group: 'com.fasterxml.jackson.core'
        exclude group: 'org.freemarker'
    }
}

当我仅在build.gradle中添加Realm时,它不会显示任何错误。但是,当我添加RealmObjects或使用RealmObject创建类时,会出现以下错误

  • 错误:找不到符号类GlideApp
  • 错误:找不到符号类GlideRequests
  • 错误:找不到符号类GlideRequest
  • 错误:找不到符号类GlideRequests其中V是类型变量:V扩展了在类ConversationAdapter中声明的View,BindableConversationItem
android realm android-glide
1个回答
0
投票

今天得到了同样的错误...由于minifyenable true而导致的错误>>

一个可能的解决方案是最小化false

© www.soinside.com 2019 - 2024. All rights reserved.