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

Unable to resolve kapt dependencies #265

Closed
chachako opened this issue Oct 14, 2020 · 18 comments
Closed

Unable to resolve kapt dependencies #265

chachako opened this issue Oct 14, 2020 · 18 comments
Assignees
Labels
problem Something isn't working

Comments

@chachako
Copy link

Describe the bug

Execution failed for task ':refreshVersions'.

Couldn't resolve version for ModuleId(group=net.ltgt.gradle.incap, name=incap-processor)

To Reproduce

  1. Use dependencies { kapt("net.ltgt.gradle.incap:incap-processor:_") }
  2. Execute :refreshVersions task
  3. See error

Additional context

Gradle Version: 6.6.1
Kotlin Version: 1.4.10
RefreshVersions Version: 0.9.5-0.9.6

@chachako

This comment has been minimized.

@LouisCAD
Copy link
Member

RefreshVersions Version: 0.9.5-0.9.6

@oh-Rin Can you confirm you have that exact same issue with the version 0.9.6?

@LouisCAD
Copy link
Member

Also, do you have mavenCentral() configured in the repositories for the affected project?

@chachako

This comment has been minimized.

@LouisCAD
Copy link
Member

@oh-Rin And if you add them manually?

@chachako
Copy link
Author

@oh-Rin And if you add them manually?

Add dependency and version to versions.properties file?

@LouisCAD
Copy link
Member

Can you try with this project and see what are the Gradle config differences that might be at play?
https://github.com/LouisCAD/kotlin-libraries-playground

Also, you can try removing the moshi version in it.

@chachako

This comment has been minimized.

@chachako

This comment has been minimized.

@LouisCAD
Copy link
Member

It should work with kapt as well.

Can you try with this project and see what are the Gradle config differences that might be at play?
https://github.com/LouisCAD/kotlin-libraries-playground

Also, you can try removing the moshi version in it.

Again, I'm asking this question @oh-Rin.

@chachako
Copy link
Author

chachako commented Oct 14, 2020

Again, I'm asking this question @oh-Rin.

Sorry, I found no problem with com.squareup.moshi:moshi-kotlin-codegen:_, but there are problems with other kapt dependencies, e.g net.ltgt.gradle.incap:incap-processor:_

@LouisCAD
Copy link
Member

Hi @oh-Rin, can you check again with version 0.9.7?

@chachako
Copy link
Author

chachako commented Oct 16, 2020

Sorry, it didn’t fix this problem, maybe the previous issue was a bit misleading, I’ll re-explain this problem now.

  1. Cloned the https://github.com/LouisCAD/kotlin-libraries-playground project
  2. Wrote kapt("net.ltgt.gradle.incap:incap-processor:_ ") to kotlin-codegen/build.gradle.kts
  3. Sync project and check versions.properties file, but found that the dependency was not written into it
  4. Finally I tried to execute :refreshVersions task, it gave an error: Couldn't resolve version for ModuleId(group=net .ltgt.gradle.incap, name=incap-processor)

And this repository is indeed valid, https://mvnrepository.com/artifact/net.ltgt.gradle.incap/incap-processor

@chachako
Copy link
Author

In addition, I provide a piece of information that may help solve this problem. I found that if I use implementation instead of kapt to import dependencies, it will get the version normally.
image

But if I use
image
to import this dependency, I will find that no information is output in the console

@LouisCAD LouisCAD added the problem Something isn't working label Oct 21, 2020
@LouisCAD LouisCAD self-assigned this Oct 21, 2020
@NikkyAI
Copy link
Collaborator

NikkyAI commented Nov 11, 2020

i also ran into this issue today.. i hope i can get around this by adding a dummy configuration or such

for now i am using this as a workaround to look up the versions manually
since other things already add the plugin.android key

@OptIn(de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi::class)
val versionsMap = de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder.readVersionProperties()

@chachako
Copy link
Author

@LouisCAD Is this problem fixed now?

@jmfayard
Copy link
Member

@chachako
it worked fine for me today
8430099

@LouisCAD
Copy link
Member

I'd be curious to know if you still encounter the issue @NikkyAI and @chachako.

If yes, there are 2 better workarounds now, otherwise, I'd be glad that the issue gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants