Can not resolve symbol/resource in Android project

Answered

Gradle project with 4 modules: java library, android library, android project, spring boot app.
I have issue with android project.
I have layout (xml) in res/layout directory and java class, where uses that layout. All works.
Now goto 'Project tool window', select xml with layout and press ctrl + c, then ctrl + v.
Studio open dialog 'Copy'. I write new name and press button OK. New xml created.
Back to java class and try change used layout to new one. I write in editor R.layout. + (ctrl + space) and... no available new xml. Ok, I manually write name of new fragment and watch red highlight (Cannot resolve symbol...)
But if I run 'Build project' - no errors. If I press ctrl + b on R.layout.myxml, moved to xml editor.
Upload screenshot by jetbrains uploads (filename eap_idea_android_prj_symbol_resolve.png)

 

IntelliJ IDEA 2019.1.1 (Ultimate Edition)
Build #IU-191.6707.61, built on April 16, 2019
Licensed to IntelliJ IDEA Evaluator
Expiration date: May 19, 2019
JRE: 1.8.0_202-release-1483-b44 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-47-generic

 

1 comment
Comment actions Permalink

Please report to Android Studio tracker https://developer.android.com/studio/report-bugs

As a possible workaround try refreshing Gradle project and build it.

0

Please sign in to leave a comment.