greenDAO icon indicating copy to clipboard operation
greenDAO copied to clipboard

can't generate Dao class because of "compileDebugKotlin Unresolved reference XXXDao"

Open liuzhp3 opened this issue 3 years ago • 4 comments

@greenrobot @greenrobot-team I meet the issue when i write the entity with java , but call Dao that haven't generated in kotlin class, report "compileDebugKotlin Unresolved reference: xxxDao" .For constrast, if i call the Dao in a java class, all going well. How can i fix that? thanks

my library module .gradle as below:

apply plugin: 'com.android.library' apply plugin: 'org.greenrobot.greendao' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'

android { compileSdkVersion 30 buildToolsVersion "29.0.3"

defaultConfig {
    minSdkVersion 29
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

}

greendao { schemaVersion 1 //database version targetGenDir 'src/main/java' //specify the directory where the code is generated daoPackage 'com.coloros.testdir.greendao' //generate code to specific packages }

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

implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation "org.greenrobot:greendao:3.2.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'

}

Originally posted by @liuzhp3 in https://github.com/greenrobot/greenDAO/issues/395#issuecomment-690122419

liuzhp3 avatar Sep 10 '20 10:09 liuzhp3

Can you please test this with the latest version 3.3.0?

We also need more error output to narrow down the issue.

greenrobot-team avatar Sep 14 '20 06:09 greenrobot-team

@greenrobot-team I Use 3.3.0 . but result is : image

liuxinghj avatar Jun 29 '23 09:06 liuxinghj

I used version 3.3.1 and the results were the same @greenrobot-team @greenrobot

liuxinghj avatar Jun 29 '23 09:06 liuxinghj

@liuxinghj Is this the same issue as reported at https://github.com/greenrobot/greenDAO/issues/1110#issuecomment-1609252219?

greenrobot-team avatar Jul 03 '23 08:07 greenrobot-team