Possible Duplicate:
Prevent ndk-build from automatically cleaning module
Android project with an NDK library. NDK r8c. Compiling under Cygwin (it's an old project).
A bunch of C++ and C files, and some .a libraries linked via LOCAL_LDLIBS.
Since some time ago, I'm noticing that every NDK build goes over all source files. Even if I call the ndk-build twice in a row, there's a full rebuild on second try. There's nothing to the effect in the .mk files that I can see, and the command I invoke to build is a vanilla $NDKPATH/ndk-build
. There's no -B option anywhere.
The only wrinkle is this: on every build, NDK says the following:
/cygdrive/c/android-ndk-r8c/build/core/add-application.mk:128: Android NDK: WARNING:
APP_PLATFORM android-9 is larger than android:minSdkVersion 3 in
/cygdrive/d/AppPath/AndroidManifest.xml
What's going on, please? Can I somehow see based on what file dates is make
making a decision to rebuild it all?
To compile and debug native code for your app, you need the following components: The Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with Android. CMake: an external build tool that works alongside Gradle to build your native library.
Go to Tools->SDK Manager (or Files->Settings->Appearance & Behavior->System Settings->Android SDK ). Then select the SDK Tools tab, and check the Show Package Details checkbox. You will see your NDK version.
NDK_PROJECT_PATH - the location of your project NDK_APPLICATION_MK - the path of the Application.mk file APP_BUILD_SCRIPT - the path to the Android.mk file. These are needed to override the default values of the build script, which expects things to be in the jni folder.
There is a known bug in r8c that causes full rebuilds even without any source code changes. See this bug report.
The suggested fix (not mine) is to change line 289 of build/core/definitions.mk from
$1: $$(__ndk_file_dir)
to
$1: | $$(__ndk_file_dir)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With