Error:(81) Android NDK: Application targets deprecated ABI(s): mips64 armeabi mips
Error:(82) Android NDK: Support for these ABIs will be removed in a future NDK release.
This is my Application.mk file
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti
APP_CPPFLAGS := -fexceptions -frtti
APP_CPPFLAGS +=-std=c++11
APP_CPPFLAGS +=-fpermissive
APP_ABI=armeabi-v7a
Redirecting to setup-app.mk
_deprecated_abis := $(filter $(NDK_DEPRECATED_ABIS),$(NDK_APP_ABI))
ifneq ($(_deprecated_abis),)
$(call __ndk_warning,Application targets deprecated ABI(s): $(_deprecated_abis))
$(call __ndk_warning,Support for these ABIs will be removed in a future NDK release.)
endif
I downloaded the ndk through Android studio.
If you run ndk-build via gradle, it ignores the APP_ABI in your Application.mk. In this case, your build.gradle should define abiFilters, e.g.
android {
ndk {
abiFilters "armeabi-v7a"
}
}
Related
I am getting the following error:
Android NDK: WARNING: APP_PLATFORM android-24 is larger than android:minSdkVersion 8 in jni/../AndroidManifest.xml
when executing:
ndk-build -C src/main/
but APP_PLATFORM is set to 8:
⋊> ~/g/gobandroid-ai-gnugo on master ⨯ cat src/main/jni/Application.mk 15:22:57
APP_PROJECT_PATH := $(call my-dir)/..
#project
APP_MODULES := gnuGo-3.8
APP_OPTIM := release
APP_BUILD_SCRIPT := $(call my-dir)/project/Android.mk
APP_ABI := armeabi armeabi-v7a x86 mips x86_64 mips64 arm64-v8a
APP_PLATFORM := android-8
The android-8 platform appears to have been obsoleted by the NDK developers. It's not available in r12-beta1, nor in r13-beta1. The oldest available platform in these releases of the NDK is android-9.
I'm using Android NDK r10d. My application.mk is setup like so:
APP_CFLAGS := -DANDROID -DBUILD_OGLES2
APP_CPPFLAGS := $(APP_CFLAGS) -fexceptions -frtti -std=c++14
APP_STL := gnustl_static
APP_ABI := armeabi-v7a
APP_PLATFORM := android-15
NDK_TOOLCHAIN_VERSION := clang
I am using std::make_unique in my code and it isn't compiling (says it isn't found). This feature should be available in STL starting with C++14. I did some poking around and it seems that clang isn't using GNU STL 4.9 in the NDK. If it were, it would be available since I see it inside <memory> header.
What am I missing here? Is there a way to use 4.9 GNU STL with clang?
make_unique isn't available through gnustl from clang. You can try using LLVM libc++ instead. Set this inside your Application.mk:
APP_STL := c++_static
NDK_TOOLCHAIN_VERSION := clang
edit:
Forcing the use of GNU STL 4.9 (by changing TOOLCHAIN_VERSION inside android-ndk-r10d/toolchains/*toolchain_name*-clang3.5/setup.mk) makes the build crash:
clang++: /s/ndk-toolchain/src/llvm-3.5/llvm/tools/clang/lib/AST/DeclBase.cpp:1293: clang::DeclContext::lookup_result clang::DeclContext::lookup(clang::DeclarationName): Assertion 'DeclKind != Decl::LinkageSpec && "Should not perform lookups into linkage specs!"' failed.
Am trying to build an android ndk app using clang instead of gcc, for know i have tried this
in the Android.mk
NDK_TOOLCHAIN_VERSION := clang
LOCAL_CLANG :=true
LOCAL_LDLIBS := -lc++_static
LOCAL_CFLAGS := -std=c++11
and in the Application.mk
APP_PLATFORM := android-9
APP_STL := libc++_static
APP_CPPFLAGS := -fexceptions -frtti
APP_ABI := armeabi-v7a
but it always give me link errors with the std library.
Any help is appreciated !
There are several mistakes in your *.mk files:
libc++_static isn't a proper value for APP_STL, it should be c++_static here.
NDK_TOOLCHAIN_VERSION has no effect when set inside Android.mk, it should be set inside Application.mk
LOCAL_CLANG is a variable used inside system modules from AOSP, not when using the NDK.
Since you're setting APP_STL as c++_static, the NDK toolchain will correctly tell the linker what lib to use, you shouldn't add LOCAL_LDLIBS := -lc++_static.
Also, you set APP_ABI to only armeabi-v7a, is it on purpose ? Android runs on other architectures as well and you'll get better performance on these if you also compile your libraries accordingly. You can either set APP_ABI to all or to a list of architectures armeabi-v7a x86...
In summary:
Android.mk
LOCAL_CFLAGS := -std=c++11
Application.mk
NDK_TOOLCHAIN_VERSION := clang
APP_PLATFORM := android-9
APP_STL := c++_static
APP_CPPFLAGS := -fexceptions -frtti
APP_ABI := all
If you continue having some troubles compiling your code, please show the exact errors you're getting.
The building settings are correct,
mostly this is happens because you are linking with library that use gcc instead of clang. check if all your linked library using clang !
I can't seem to get the android NDK to have C++11 support. Considering I'm only porting another person's project to android through the ndk, I really don't have any experience with c++ before now.
My application.mk:
NDK_TOOLCHAIN_VERSION := clang
APP_STL := c++_static
APP_CPPFLAGS := -std=c++11 -frtti -fexceptions
APP_ABI := all
APP_PLATFORM := android-8
Thanks in advance!
I want to compile my NDK code using gnu libstdc++, any clue how to do this?
You should add a line to Application.mk
APP_STL := gnustl_static
if you want to link it statically, and
APP_STL := gnustl_shared
if you want to use it as a shared library.
Here is the example of typical Application.mk (it should be placed into the same folder where your Android.mk is located):
APP_OPTIM := release
APP_PLATFORM := android-7
APP_STL := gnustl_static
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DANDROID
APP_ABI := armeabi-v7a
More information on Application.mk can be found in your NDK docs: docs/APPLICATION-MK.html
Add the following line to your Application.mk:
APP_STL := gnustl_static
(or gnustl_shared if you don't want to link statically against it).