polymonster / premake-android-studio

premake5 module for android-studio and gradle build.
MIT License
34 stars 15 forks source link

C++ files not listed in projects #5

Closed Gaztin closed 3 years ago

Gaztin commented 5 years ago

My C++ files for all of my projects seem to build correctly, but Android Studio is failing to add them to the project view, hence all auto completion and highlighting is broken.

My source files are located under src/ and my project files are generated under build/android-studio/ and if I move my source files there as well, AS adds them without problem. It seems to treat my source files as "external". Is there something I can do to fix this?

polymonster commented 5 years ago

I am currently using android studio 3.1.4 and C++ files are being correctly added to the project and are visible, but I think a co-worker with a newer version of android studio is seeing this same issue.

I will take a look into it.

polymonster commented 5 years ago

Turns out it is just header files we cant see in android studio solution explorer. Our projects are laid out like this:

project

We only have 1 java file which is our main activity and this is located in a different folder to the cpp files... are you mixing java and cpp files under the same directory? I did have some issues with mixed cpp and java files when initially making this project.

Gaztin commented 5 years ago

I see. My project structure looks something like this:

+-- build
|   +-- android-studio/
|       +-- <generated-project-files>
+-- src
    +-- android/
    |   +-- java/<package-name>/
    |   |   +-- <Java files>
    |   +-- res/values/
    |   |   +-- strings.xml
    |   +-- AndroidManifest.xml
    +-- main.cpp

So I'm not directly 'mixing' java and cpp files, but they do share parent directories beneath the project root (src in this case).

Edit: Moving the java files outside of the src directory does not fix it.

Gaztin commented 3 years ago

Revisiting this two years later I can see that the error seems to have gone away. Was most likely a bug related to gradle or Android Studio. Closing this!

polymonster commented 3 years ago

Great to hear! Thanks for updating.