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

New Gradle version doesn't show ksp generated files in Android Studio #335

Closed
k4vrin opened this issue Jan 15, 2023 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@k4vrin
Copy link

k4vrin commented Jan 15, 2023

Hello Everyone.
Recently I updated my Android Studio to Electric eel and Gradle to version 7.5 and AGP 7.4 and suddenly the Ksp generated files couldn't be accessed in the main project. after some searching, I found a google issue that suggested a workaround that works for me:

   applicationVariants.all {
        kotlin.sourceSets {
            getByName(name) {
                kotlin.srcDir("build/generated/ksp/$name/kotlin")
            }
        }
    }

    applicationVariants.all {
        addJavaSourceFoldersToModel(File(buildDir, "generated/ksp/$name/kotlin"))
    }

I just wanted to put this here for reference and save some people the headache.
the google issue: KSP Generated sources not found after upgrading gradle plugin to from 7.4.0-beta02 to 7.4.0-beta03

P.S.: I just found out this issue is duplicated. feel free to remove it. Sorry for the Inconvenience 

@mpost
Copy link

mpost commented Jan 16, 2023

This is the same issue as previously reported on canary releases of the AGP plugin. #314. I also just realized that you mentioned this to be a dup. :)

I hope this can be resolved. It could become a tombstone for the library.

@raamcosta raamcosta added the duplicate This issue or pull request already exists label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants