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

Generated source dependencies not found under canary AGP 8.0.0-alpha09 #314

Closed
mpost opened this issue Dec 9, 2022 · 12 comments
Closed
Labels
dependency There is an issue that is caused by a dependency we use internally.

Comments

@mpost
Copy link

mpost commented Dec 9, 2022

Setting up a project to use compose-destinations with the android gradle plugin 8.0.0-alpha09 does generated the correct sources but they are not correctly picked up by setting the source dir to the generated folder.

Using the current stable version 7.3.1 of the AGP plugin does work as expected.

Is there some documentation on what version of the AGP plugin is compatible? Also is there a way to make it work with the Canary version?

@Jacob3075
Copy link

Facing same issue, have not tried using lower versions of AGP.
The IDE gives an error saying it can't find the NavGraphs class even tho it is generated, but I'm able to build the project so gradle is picking it up only the IDE can't find it.

Compose destinations version: 1.7.25-beta
kotlin version: 1.7.20
ksp: 1.7.20-1.0.8
AGP: 8.0.0-alpha09
IDE: Build #AI-222.4345.14.2221.9321504, built on November 23, 2022

@raamcosta
Copy link
Owner

Hi guys 👋

looks like an issue with IDE and AGP indeed.
I found this
google/ksp#37 (comment)

(Last retry says it works if you specify the source sets in a different way? 🤷‍♂️)

And this:
https://issuetracker.google.com/issues/255915317
(Supposed to be fixed though? 🤔)

I’m afraid not much I can do here, let’s see if we have some news soon 🤞

@raamcosta raamcosta added the dependency There is an issue that is caused by a dependency we use internally. label Dec 10, 2022
@mpost
Copy link
Author

mpost commented Dec 12, 2022

Thanks for looking into it. It looks as if https://issuetracker.google.com/issues/255915317 would have solved the issue. Might not have landed in AGP alpha9 yet. Keeping fingers crossed.

@mpost
Copy link
Author

mpost commented Dec 22, 2022

I think the issue has not been resolved in 8.0.0-alpha10. Could anybody else confirm?

@Nek-12
Copy link

Nek-12 commented Dec 30, 2022

Change your ksp configuration to

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

@MaxMichel2
Copy link
Contributor

This is also the case with AGP 7.4.0 (I was wondering if this was linked to the library but it seems that AGP is the culprit)

@raamcosta
Copy link
Owner

raamcosta commented Jan 22, 2023

I was able to fix this in this commit:

COMMIT: 9101a1a

I used the workaround explained in the google issue and it is working for me.

@mpost
Copy link
Author

mpost commented Jan 23, 2023

I can confirm that the updated declaration via the java source set works with AGP 7.3.1 (previous min supported version) and AGP 7.4.0 (the min not working version). I also tried with 8.1.0-alpha01 but that caused some different issues in my test setup, likely due to an early alpha of the AGP plugin.

@sc941737
Copy link

sc941737 commented Feb 2, 2023

I was able to fix this in this commit:

COMMIT: 9101a1a

I used the workaround explained in the google issue and it is working for me.

Didn't have this issue until I refactored the app to use multiple modules. However this fixed it for me!

@raamcosta
Copy link
Owner

We now have multiple solutions for this KSP related issue. Either use the above mentioned fix, or migrate to KSP 1.8.0-1.0.9 which completely fixes this, so you can remove all these explicit indications of the generated files in the build.gradle.

Given this, I'm closing the issue, let me know if you're still dealing with something similar.

@mpost
Copy link
Author

mpost commented Feb 13, 2023

I can confirm that removing the explicit source location is not required with ksp 1.8.10 and agp 7.4.0.

@raamcosta
Copy link
Owner

Added a warning on top of readme file too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency There is an issue that is caused by a dependency we use internally.
Projects
None yet
Development

No branches or pull requests

6 participants