Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liuzhp3 opened this issue Sep 10, 2020 · 4 comments

Comments

@liuzhp3
Copy link

liuzhp3 commented Sep 10, 2020

@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 #395 (comment)

@greenrobot-team
Copy link
Collaborator

Can you please test this with the latest version 3.3.0?

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

@liuxinghj
Copy link

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

@liuxinghj
Copy link

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

@greenrobot-team
Copy link
Collaborator

@liuxinghj Is this the same issue as reported at #1110 (comment)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants