1

I have a Android project which doesn't use the NDK jet Gradle is looking for the NDK.

Either I get this Error:

 No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android

Or I get this warning:

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /opt/local/share/java/android-sdk-macosx/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Even when ANDROID_NDK_HOME and ndk.dir is unset. It there a way to built the system without those annoying messages?

Martin
  • 11,577
  • 16
  • 80
  • 110

3 Answers3

2
  1. Try to download the NDK (from: https://developer.android.com/ndk/downloads/) separately and unzip it to your prefered location, e.g. ~/Library/Android/ndk/android-ndk-r18b

  2. Open your local.properties file which probably looks like below

     ndk.dir=~/Library/Android/sdk/ndk-bundle
     sdk.dir=~/Library/Android/sdk
    
  3. Change the ndk.dir to ~/Library/Android/ndk/android-ndk-r18b

Or you can try the solution from here: https://github.com/google/filament/issues/15#issuecomment-415423557

Tyler
  • 21,762
  • 11
  • 61
  • 90
shizhen
  • 12,251
  • 9
  • 52
  • 88
1

Uninstall the NDK or update your gradle plugin version. There was a bug in older versions of the plugin where it would perform an invalid sanity check on the NDK even for a Java only project. IIRC 3.2 is the fixed version.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79
  • What is worse then no sanity check? A faulty sanity check! It's better to have no sanity check then to have an invalid sanity check so one should think twice before adding one. – Martin Oct 26 '18 at 08:47
0

check your build.gradle file, if you have something like this in externalNativeBuild tag;

ndk {
        abiFilters 'armeabi-v7a' ...
     }

or like this;

cmake {
            cppFlags "-frtti -fexceptions"
        }

or maybe like this;

cmake {
            path 'src/CMakeLists.txt'
        }

try to remove them

parliament
  • 371
  • 1
  • 5
  • 18
  • I **don't** have an `externalNativeBuild` tag. Because it's a bog standard java project. **NO** native and **NO** external stuff at all. – Martin Oct 17 '18 at 13:22