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

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

Open
itsandreramon opened this issue Jul 19, 2021 · 18 comments
Open

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

itsandreramon opened this issue Jul 19, 2021 · 18 comments

Comments

@itsandreramon
Copy link

itsandreramon commented Jul 19, 2021

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

@jmfayard
Copy link
Member

jmfayard commented Aug 8, 2021

Gradle Sync issue?

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

@itsandreramon
Copy link
Author

itsandreramon commented Aug 8, 2021

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

@jmfayard jmfayard added problem Something isn't working and removed question labels Aug 8, 2021
@jmfayard
Copy link
Member

jmfayard commented Aug 8, 2021

I can reproduce it.

@jmfayard jmfayard changed the title Cannot resolve symbol 'de' Cannot resolve symbol 'de.fayard.*' in Android Studio Aug 8, 2021
@LouisCAD
Copy link
Member

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 LouisCAD added waiting-for-reply and removed problem Something isn't working labels Aug 23, 2021
@LouisCAD
Copy link
Member

@itsandreramon Still waiting for your answer.

@itsandreramon
Copy link
Author

@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!

@LouisCAD
Copy link
Member

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.

@taylors1512
Copy link

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.

@LouisCAD
Copy link
Member

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

@itsandreramon
Copy link
Author

@taylors1512 @LouisCAD does not work on my end

@LouisCAD
Copy link
Member

LouisCAD commented Feb 1, 2022

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 LouisCAD closed this as completed Feb 1, 2022
@LouisCAD LouisCAD reopened this Feb 1, 2022
@LouisCAD
Copy link
Member

LouisCAD commented Feb 1, 2022

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

@taylors1512
Copy link

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.

@jmfayard
Copy link
Member

@LouisCAD
Copy link
Member

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

@jmfayard
Copy link
Member

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
Copy link
Member

See #609

@LouisCAD
Copy link
Member

#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 LouisCAD reopened this Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants