refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Cannot resolve symbol 'de.fayard.*' in Android Studio

Open itsandreramon opened this issue 4 years ago • 18 comments

When using this plugin, the versionFor method import gets marked as an error by the IDE because the de namespace cannot be resolved. The plugin works as expected, however.

I am using version 0.10.1

This is how it looks: Screenshot 2021-07-19 at 17 22 08

itsandreramon avatar Jul 19 '21 15:07 itsandreramon

Gradle Sync issue?

I can't see what would be the problem apart from that.

jmfayard avatar Aug 08 '21 04:08 jmfayard

I don't think so, had this problem since the beginning and updated AS and Gradle several times in between. I can check with 0.11.0 though

Edit: Still happening on AS 2020.3.1 + Gradle 7.1.1 and refreshVersions 0.11.0

itsandreramon avatar Aug 08 '21 11:08 itsandreramon

I can reproduce it.

jmfayard avatar Aug 08 '21 13:08 jmfayard

Hello, @itsandreramon, did you configure refreshVersions for the buildSrc as well, as recommended on the setup page on the website for Groovy DSL users?

https://jmfayard.github.io/refreshVersions/setup/#if-you-use-groovy-dsl-ie-buildgradle-files-not-kts

LouisCAD avatar Aug 23 '21 22:08 LouisCAD

@itsandreramon Still waiting for your answer.

LouisCAD avatar Dec 18 '21 23:12 LouisCAD

@LouisCAD I configured buildSrc and it works now. However, I think the docs should be more clear, that you should configure buildSrc as well. The docs currently only say:

"Auto-completion for dependency notations won’t work out of the box."

In my case, I am not using auto-completion because I use version catalogs and the statement above makes it seem optional. Anyways, thank you for the help and the project!

itsandreramon avatar Dec 19 '21 06:12 itsandreramon

Gotcha, I'll consider updating the docs to reflect that, thanks for the update, glad it's now working on your end.

We are also considering automatically configuring buildSrc BTW.

LouisCAD avatar Dec 19 '21 08:12 LouisCAD

Thanks for the tips. This has been annoying me for a long time.

By the way, I found I had to just include the following code in buildSrc/settings.gradle

pluginManagement {
    plugins {
        id 'de.fayard.refreshVersions'
    }
}

I'm just pointing this out as the URL you linked to @LouisCAD suggested the following:

pluginManagement {
    plugins {
        id 'de.fayard.refreshVersions' version '0.40.0'
    }
}

plugins {
    id 'de.fayard.refreshVersions'
}

I wanted to avoid stipulating the version number here in buildSrc/settings.gradle as I am already doing this in my ./settings.gradle.

martin-stephens avatar Jan 26 '22 14:01 martin-stephens

@taylors1512 Is Gradle sync working with that in IntelliJ IDEA?

LouisCAD avatar Jan 26 '22 14:01 LouisCAD

@taylors1512 @LouisCAD does not work on my end

itsandreramon avatar Feb 01 '22 09:02 itsandreramon

That's what I expected, and that's why refreshVersions docs show to specify the version for the buildSrc as well.

If you don't, when Gradle sync tries to run the buildSrc in standalone mode, it can't find the version and fails.

LouisCAD avatar Feb 01 '22 09:02 LouisCAD

Reopening as a reminder to alert users with an error message when buildSrc is not set up but Groovy DSL is used.

LouisCAD avatar Feb 01 '22 09:02 LouisCAD

sorry, just saw your question @LouisCAD.

Actually, yes, correct, my method isn't working - i.e. stipulating the plugin without the version number. Maybe last time I did it the official way, and then by accident it worked when I tried after without the version number?

Cheers for the tips again and clarification.

martin-stephens avatar Feb 15 '22 12:02 martin-stephens

I think the documentation is fine? https://jmfayard.github.io/refreshVersions/setup/#if-you-use-groovy-dsl-ie-buildgradle-files-not-kts

jmfayard avatar Sep 13 '22 22:09 jmfayard

@jmfayard Did you skip my last comment about why I re-opened this issue?

LouisCAD avatar Sep 14 '22 00:09 LouisCAD

Seen it now.

I think it's best for this kind of issues to document it better first. More code is not the solution to all problems, and it can be done later.

Added it in https://github.com/jmfayard/refreshVersions/wiki/Troubleshooting

jmfayard avatar Sep 14 '22 06:09 jmfayard

See https://github.com/jmfayard/refreshVersions/issues/609

jmfayard avatar Sep 14 '22 06:09 jmfayard

#609 doesn't really seem compatible with the issues we talked about in the last comments.

Re-opening again so we don't forget, because better late than never.

LouisCAD avatar Sep 19 '22 04:09 LouisCAD