greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

Generated files show error 'Cannot resolve symbol' #1079

Closed parthanjaria closed 2 years ago

parthanjaria commented 2 years ago

I have upgarded my project greendao library from 2.1.0 to 3.3.0 version. When I generate the file, there is no error while generating the files, but when I open those files I can see errors like :

Cannot Resolve symbol 'AbstractDaoMaster' or Cannot Resolve symbol 'database' etc in all the generated files like DaoMaster, DaoSession or the entities files.

As seen in #352 I did changes in my gradle as shown below :

This is my app module gradle :

`import com.github.triplet.gradle.androidpublisher.* buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/' } }

dependencies {
    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.8, 0.99.99]'
    classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
}

}

apply plugin: 'org.greenrobot.greendao' apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'kotlin-kapt' apply plugin: "com.github.triplet.play" apply plugin: 'com.google.firebase.firebase-perf'

android { compileSdkVersion DefaultConfig.compileSdk buildToolsVersion '30.0.3' defaultConfig { applicationId App.impact minSdkVersion DefaultConfig.minSdkOriginal targetSdkVersion DefaultConfig.targetSdk versionCode 712 versionName "2.26.5" generatedDensities = [] vectorDrawables.useSupportLibrary = true manifestPlaceholders = [manifestApplicationId : "${applicationId}", onesignal_app_id : OneSignal.appId, onesignal_google_project_number: OneSignal.googleProjectNumber] multiDexEnabled true resConfigs "en" } signingConfigs { release { * } }

sourceSets {
    orignal {
        manifest.srcFile 'src/main/AndroidManifest.xml'
        java.srcDirs = ['src/main/java', 'src/main/java-gen']
        res.srcDirs = ['src/main/res']
    }

    development {
        res.srcDirs = ['src/beta/res']
    }
}

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }
    debug {
        debuggable true
        signingConfig signingConfigs.release
        ext.alwaysUpdateBuildId = false
    }
}

flavorDimensions("orignal", "development")
productFlavors {
    orignal {
        minSdkVersion DefaultConfig.minSdkOriginal
        dimension = "orignal"
    }
    development {
        minSdkVersion DefaultConfig.minSdkDevelopment
        dimension = "development"
        resConfigs("en", "xxhdpi")

    }
}
aaptOptions {
    additionalParameters "--no-version-vectors"
}

dexOptions {
    jumboMode = true
}

lintOptions {
    disable 'Range'
    disable 'InvalidPackage'
    baseline file("lint-baseline.xml")
}

kotlinOptions {
    jvmTarget = '1.8'
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

play { * }

greendao { schemaVersion 24 }

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation project(path: ':network')

testImplementation Deps.junit
testImplementation Deps.mockitoCore
testImplementation Deps.mockitoInline
testImplementation Deps.nhaarmanMockito
testImplementation Deps.coreTesting
testImplementation Deps.jsonTesting

androidTestImplementation Deps.testCore
androidTestImplementation Deps.testRunner
androidTestImplementation Deps.testRules

implementation Deps.playServiceLocation
implementation Deps.playServiceMap
implementation Deps.playServiceFitness
implementation Deps.playServiceAuth
implementation Deps.playServicePlus
implementation Deps.playServiceGcm
implementation Deps.playServiceAnalytics
implementation Deps.playCore
implementation Deps.playCoreKtx

implementation Deps.lifecycleExtension
implementation Deps.lifecycleCommonJava8

implementation Deps.firebaseMessaging
implementation Deps.firebaseAnalytics
implementation Deps.firebaseInAppMessaging
implementation Deps.firebaseInAppMessagingDisplay
implementation Deps.firebaseDynamicLinks
implementation Deps.firebaseConfig
implementation Deps.firebaseUIAuth
implementation Deps.firebasePerformanceMonitoring

implementation Deps.rxAndroid
implementation Deps.rxJava
implementation Deps.rxKotlin

implementation Deps.awsAndroidSdkMobileClient
implementation Deps.awsAndroidSdkS3
implementation Deps.awsAndroidSdkCognito

implementation Deps.appCompat
implementation Deps.browser
implementation Deps.material
implementation Deps.legacySupport
implementation Deps.vectorDrawable
implementation Deps.recyclerview
implementation Deps.cardview
implementation Deps.constraintLayout
implementation Deps.picasso
implementation Deps.picasso2OkHttpDownloader
implementation Deps.gson
implementation Crashlytics.sdk
implementation(Deps.oneSignal) {
    exclude group: 'com.google.android.gms', module: 'play-services-location'
    exclude group: 'com.google.android.gms', module: 'play-services-base'
    exclude group: 'com.google.android.gms', module: 'play-services-ads-identifier'
    exclude group: 'com.google.firebase', module: 'firebase-iid'
    exclude group: 'com.google.firebase', module: 'firebase-messaging'
}
implementation Deps.facebookLogin
implementation Deps.butterKnife
kapt Deps.butterKnifeCompiler
implementation Deps.greenDao
implementation 'org.greenrobot:greendao-generator:3.3.0'
implementation Deps.eventBus
implementation Deps.kotlinStdlib
implementation Deps.mpAndroidChart
implementation(Deps.lumiere) {
    exclude group: 'com.google.firebase'
}
implementation Deps.multidex
implementation Deps.materialShowcaseView
implementation Deps.materialTapTargetPrompt
implementation Deps.androidApt
implementation Deps.imageCropper
implementation Deps.konfetti
implementation Deps.freshchat
implementation Deps.circleImageView
implementation files(Deps.samsungHealthData)
implementation Deps.decoViewCharting
implementation Deps.lottie
implementation Deps.workRuntime
implementation Deps.shimmer
implementation Deps.timber
implementation Deps.palette
implementation Deps.rxBinding
implementation Ads.inMobi
implementation Ads.playService
implementation Deps.amplitude
implementation Deps.okhttp3

}`

And I have created a module to implement greendao so this is their gradle :

`apply plugin: 'java' apply plugin: 'application'

mainClassName = "com.dao.SchemaGenerator" project.ext.outputDir = "../app/src/main/java-gen"

task createDocs { def docs = file(project.ext.outputDir) docs.mkdirs() }

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'org.greenrobot:greendao-generator:3.3.0' }`

This is the error I can see :

image

Where am I going wrong or the issue still exsists?

parthanjaria commented 2 years ago

I had issue with the implementation. Once I followed this I was able to work.