nowinandroid icon indicating copy to clipboard operation
nowinandroid copied to clipboard

[Bug]: Showing "Unresolved reference: build" in build-logic:convention module

Open nabeelahamedk opened this issue 1 year ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is there a StackOverflow question about this issue?

  • [X] I have searched StackOverflow

What happened?

The project builds and runs successfully but android studio shows errors in Plugin classes that uses imports under com.android.build package. And also the namespace field in build.gradle.kts files also shows error.

Related issue closed last year

Attached screenshots of both errors.

Attached screenshots of issue Screenshot 2023-12-11 at 8 24 15 PM Screenshot 2023-12-11 at 8 24 44 PM Screenshot 2023-12-11 at 8 25 08 PM

Relevant logcat output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

nabeelahamedk avatar Dec 11 '23 14:12 nabeelahamedk

@nabeelahamedk, please give details on your setup. Android Studio version, OS, stacktrace, Gradle scan, steps to reproduce etc. We've never been able to reproduce it, and this looks like an "environment" error we won't be able to fix.

SimonMarquis avatar Dec 11 '23 19:12 SimonMarquis

Android Studio Hedgehog 2023.1.1 MacOS Sonoma 14.1.2

The builds are running fine. But the classes related to com.android.build package showing red underlines and showing unresolved reference.

The underlines are only showing if I open the files. And the Android Studio can't be able to import automatically.

nabeelahamedk avatar Dec 11 '23 19:12 nabeelahamedk

Can you share your settings in File | Settings | Build, Execution, Deployment | Build Tools | Gradle?

SimonMarquis avatar Dec 11 '23 20:12 SimonMarquis

Attached screenshot of settings. Screenshot 2023-12-12 at 9 48 37 AM

nabeelahamedk avatar Dec 12 '23 06:12 nabeelahamedk

Try to File | Invalidate caches, and if it still doesn't work, try File | Repair IDE.

SimonMarquis avatar Dec 12 '23 09:12 SimonMarquis

@SimonMarquis Tried both but no result.

nabeelahamedk avatar Dec 12 '23 12:12 nabeelahamedk

Then you might have to open a ticket on the Android Studio bug tracker (or +1 any already existing ticket related) as this bug is not directly related to this project.

SimonMarquis avatar Dec 12 '23 15:12 SimonMarquis

@SimonMarquis Tried in a different project and Iguana canary version also but no result. I think I need to raise a ticket for Android Studio.

nabeelahamedk avatar Dec 13 '23 10:12 nabeelahamedk