3

I recently upgraded my NDK from android-ndk-r9 to android-ndk-r10 (r10d to be exact). Eclipse is 4.4 Luna (Luna Service Release 1 (4.4.1); Build id: 20140925-1800). Eclipse is fully patched for its release. I updated all the Eclipse plugins (including ADT) so they are fully patched. And I also changed my ANDROID_NDK_ROOT in .bash_profile to point to the new NDK directory.

Under the Eclipse Preferences → Android → NDK, Eclipse is showing the new android-ndk-r10 path (I had to set it manually).

Under the Project Properties → C/C++ General → Paths and Symbols, Eclipse is still showing the old android-ndk-r9 path.

enter image description here

Eclipse considers the path built-in, and unchecking the Show built-in values check box makes all the paths disappear. In addition, the Edit... button is greyed out.

I've grepped the following directories, and I cannot find the string "android-ndk-r9":

  • My Eclipse workspace
  • ~/.eclipse
  • The project's directory
  • ~/Library
  • /Application/Eclipse
  • /etc on the OS X machine
  • /Library on the OS X machine

The project builds fine. The bad configuration just creates hundreds of errors in the list on the Problems tab. (To duplicate, you need to open a C or C++ file):

enter image description here

Where is the setting coming from? And how do I change it?


This appears to be related: How to remove auto-discovered paths after compiling on Linux from Eclipse CDT project?. But I can't find Discovery Options → Clear discovery entries now (it appears to be a Eclipse 3.x feature). Ditto for Eclipse CDT Invalid Project Path.


This appears to be the Eclipse bug report covering the issue: Include path discovery doesn't discard obsolete paths on compiler upgrade.

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885
  • Can you give an example of the TODO errors? – weston Jan 12 '15 at 09:18
  • And those errors refer to files in NKD9? – weston Jan 12 '15 at 09:23
  • @weston - it appears to refer to anything C or C++ related. For example, my project is showing problems with `clock_gettime` (C call) and `vector` (C++ data structure). I added an image of it to the question. – jww Jan 14 '15 at 02:27

2 Answers2

2

Where is the setting coming from?

It appears the information is held in the project's pathInfo file. Below, the project is a sample JNI project called AndroidPrng.

$ cat /Users/jww/Eclipse/.metadata/.plugins/com.android.ide.eclipse.ndk/AndroidPrng.pathInfo 
t,1421045575000
i,/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport
i,/usr/local/cryptopp/android-armeabi/include
i,/opt/android-ndk-r9/sources/cxx-stl/system/include
i,/usr/local/cryptopp/android-armeabi/include/cryptopp
i,jni
i,/opt/android-ndk-r9/platforms/android-14/arch-arm/usr/include
i,/usr/local/cryptopp/android-x86/include
i,/usr/local/cryptopp/android-x86/include/cryptopp
i,/opt/android-ndk-r9/platforms/android-14/arch-x86/usr/include
i,/usr/local/cryptopp/android-mips/include
i,/usr/local/cryptopp/android-mips/include/cryptopp
i,/usr/local/cryptopp/android-armeabi-v7a/include
i,/usr/local/cryptopp/android-armeabi-v7a/include/cryptopp
i,/opt/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.6/include
i,/opt/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.6/include-fixed
i,/opt/android-ndk-r9/platforms/android-14/arch-mips/usr/include
d,__STDC__,1
d,__INT64_MAX__,9223372036854775807LL
d,__LDBL_HAS_QUIET_NAN__,1
d,__WINT_TYPE__,unsigned int
d,__ORDER_LITTLE_ENDIAN__,1234
d,__DEC64_MAX_EXP__,385
d,__UINT_LEAST32_TYPE__,unsigned int
d,__UINT_FAST64_TYPE__,long long unsigned int
d,__GXX_WEAK__,1
...

I've grepped the following directories ... "My Eclipse workspace, ~/.eclipse, " ...

There were two problems here. First, the project is located on my desktop, and not my workspace directory. Second, the 100's of entries in the log files under org.eclipse.cdt.ui drowned out the entries 15 entries for com.android.ide.eclipse.ndk.

So, before you grep, perform:

rm Users/jww/Eclipse/.metadata/.plugins/org.eclipse.cdt.ui/*.log

That will produce manageable grep results.


And how do I change it?

Exercise left to the reader.

You can edit by hand; or you can delete it and Eclipse will recreate it with the new NDK-related paths.

jww
  • 97,681
  • 90
  • 411
  • 885
2

OP probably figured this out already but adding this here just for future reference.

Eclipse (currently) has issues with the r10d version (see the related discussion in https://stackoverflow.com/a/28108753/1591421). First, if possible one should rollback to an earlier version of the Android NDK (e.g. r10c seems to work just fine) and then make Eclipse point to the newly installed version of the NDK: Preferences -> Android -> NDK -> NDK Location. To let Eclipse pick up these changes the project needs to be deleted from the workspace and then added back (at least I had to). After the project has been re-imported one should see the NDK paths updated: Project -> Properties -> C/C++ General -> Paths and Symbols. Rebuilding the C/C++ Index (Project -> C/C++ Index -> Rebuild) won't hurt either :)

Community
  • 1
  • 1
MMrko
  • 31
  • 3