Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: This file not part of the project, but the project builds successfully

I have a strange problem that suddenly appeared in android studio. I created a new cpp file, and included it in Android.mk. Then I synced the project. However, android studio still complains that the file is not part of the project and that I need to sync, BUT the whole project builds successfully.

Likewise, if I remove one of the other older files from Android.mk that it did not complain about, and resyncs and then tries to build the project, as expected the build fails, but android studio does NOT complain that that file is not part of the project anymore.

So somehow, suddenly the android studio editor is not able to correctly identify which files have been synced and are part of the project, but during compilation everything works as expected.

Does anyone know how to fix this annoying problem? I have tried clean project, invalidate caches/restart as well as updating android studio without luck (AS version 3.4).

like image 473
Jonathan Lindgren Avatar asked Apr 24 '19 09:04

Jonathan Lindgren


1 Answers

I used Build > Refresh Linked C++ Projects menu and it worked.

Menu Preview in Android Studio

like image 76
Sdghasemi Avatar answered Oct 28 '22 10:10

Sdghasemi