serpro69 / kotlin-faker

Port of a popular ruby faker gem written in kotlin. Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.
https://serpro69.github.io/kotlin-faker/
MIT License
469 stars 43 forks source link

Could not find org.jetbrains.kotlin:kotlin-reflect:. #253

Open serpro69 opened 5 days ago

serpro69 commented 5 days ago

Ref: https://github.com/serpro69/kotlin-faker/issues/250#issuecomment-2440920179

Changes since last rc: https://github.com/serpro69/kotlin-faker/compare/v2.0.0-rc.6...8e77afdc7ece6b265099e61f1f530699fec5777e

serpro69 commented 5 days ago

@dees91 , I couldn't reproduce your issue on my end. I've just made a simple project in intellij w/o any dependencies but kotlin-faker, and that seems to work: https://github.com/serpro69/kotlin-faker-issue-253

Can you see if the same project works for you? And can you try to reproduce your issue there?

I wonder if the missing dependencies are due to some android specifics, where you need to explicitly add kotlin-reflect or smth like that?

Also, when I try to list dependencies from your repro project, I can see reflect dependency is reported as failed in a lot of places. So something is definitely going awry in the build process:

➜ ./gradlew :app:dependencies > deps.txt

mp.oKtCHvux8B on  main [?] is 📦 unspecified via 🅺 v2.0.20 via ☕ v17.0.12 …
➜ cat deps.txt | grep reflect
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
|    +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     |    +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
          +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
|    +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
|    +--- org.jetbrains.kotlin:kotlin-reflect FAILED
|    +--- org.jetbrains.kotlin:kotlin-reflect FAILED

Also, is it possible for you to bump kotlin to 2.0.20 or later? That's the only thing I can think of what could be causing dependency discrepancies. And it's also what has changed since kotlin-faker:2.0.0-rc.6, which was still on kotlin 1.9

dees91 commented 5 days ago

I get a similar error in the project https://github.com/serpro69/kotlin-faker-issue-253:

kotlin-faker-issue-253:main: Could not find org.jetbrains.kotlin:kotlin-reflect:.
Required by:
    project : > io.github.serpro69:kotlin-faker:2.1.0-SNAPSHOT:20241028.081202-24

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

more info:

$ ./gradlew dependencies > deps.txt
$ cat deps.txt | grep reflect
     |    +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
          +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED
     +--- org.jetbrains.kotlin:kotlin-reflect FAILED

Maybe it works for you because you have something in the gradle cache and I don't?

serpro69 commented 5 days ago

Thanks for the info @dees91 !

I've cleaned local caches for both maven and gradle, and I can still run the code locally. However, the failed dependency I'm also getting now in the graph. So I'll try to find the root cause of that, and hopefully that will fix this issue.