0

Is it not possible to comment out lines in the top-level Android.mk file of an Android Studio NDK project?

If I remove the Hello.mk line shown below, I get no errors. If I add a # then I get the error "This file is not part of the project."

How can I temporarily remove this line (i.e. comment it out) ?

enter image description here

SparkyNZ
  • 6,266
  • 7
  • 39
  • 80

1 Answers1

1

For some weird reason Android Studio tries to treat your Android.mk as a C++ source. You can safely ignore this and many other warnings that AS displays.

OTOH, you can safely delete the line, instead of adding # in front: Android Studio keeps local history of the files that you edit thorough it; so, you can easily restore any changes to this file when you need that.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • I tend to comment out lines when I want to try something out. In this case I wanted to try building SQLite on its own without the Hello.mk but I can always undo/redo. – SparkyNZ Dec 19 '17 at 23:46
  • 1
    If you believe that you discovered a bug in Android Studio, and can reproduce it, don't hesitate to [file a ticket](https://developer.android.com/studio/report-bugs.html)! – Alex Cohn Dec 19 '17 at 23:55
  • Now that I know I how to optionally specify 'targets' (and possibly comment them out within the build.gradle file), I can exclude targets from the build there instead. – SparkyNZ Dec 19 '17 at 23:56
  • Bug reported filed! :-) – SparkyNZ Dec 20 '17 at 00:01
  • Hi @AlexCohn , Can you help me with this: https://stackoverflow.com/questions/47903357/android-studio-ndk-linker-error-undefined-reference-to-cv-outputarray-outpu – Karthik Sivam Dec 20 '17 at 13:43