APP_PLATFORM is ignored - android

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.

Related

*** No rule to make target `src/main/jni/Build.config'. Stop

Since I downgraded my NDK version to 14-16 (because of no GCC support in newer versions), I am facing this error
*** No rule to make target `src/main/jni/Build.config'. Stop
I can't understand why in the old versions of the NDK it says no such file or directory in Android.mk file this line src/main/jni/Build.config.
Here's a typical setup.
I don't know what's in your src/main/jni/Build.config file, pretty sure it is not used or needed (please show it's contents).
.../app/build.gradle:
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}//ndkBuild
}//externalNativeBuild
.../app/src/main/jni/Application.mk:
#APP_ABI := armeabi armeabi-v7a x86 mips
APP_ABI := armeabi-v7a
APP_PLATFORM := android-19
APP_STL := stlport_static
#APP_OPTIM := debug
.../app/src/main/jni/Android.mk:
#=======================================================
LOCAL_PATH := $(call my-dir) #only call it ONCE !
#=======================================================
include $(CLEAR_VARS)
LOCAL_MODULE := hello_world
LOCAL_MULTILIB := 32
LOCAL_SRC_FILES := hello_world.cpp
include $(BUILD_SHARED_LIBRARY)
#-------------------------------------------------------
Links
android-gcc-toolchain
Check if you have a file called src/main/jni/Build.config available to make.
Make sure you are in the right directory when run ndk-build.

Ndk error Application target deprecated

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"
}
}

build android with clang instead of gcc ? and the clang stl lib instead of gnustl lib?

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 !

Unable to use ndk-gdb

when i run ndk-gdb in cgywin i get error saying "make: command not found" and "the device does not support the applications targetted CPU abi's"
$ ndk-gdb --verbose --nowait
Android NDK installation path: /cygdrive/c/Android/ndk
Using default adb command: /cygdrive/c/Android/sdk/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.31
Using ADB flags:
Using JDB command:
Using auto-detected project path: .
Found package name: com.example.mygame
/cygdrive/c/Android/ndk/ndk-gdb: line 120: make: command not found
ABIs targetted by application:
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
ERROR: The device does not support the application's targetted CPU ABIs!
Device supports: armeabi-v7a armeabi
Package supports:
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := \
c:/cocos2d-x/external/Box2D
LOCAL_MODULE := mygame
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static box2d_static
LOCAL_SRC_FILES := \
b2DebugDraw.cpp \
Box2DRenderer.cpp \
Main.cpp \
InGameScreen.cpp
include $(BUILD_SHARED_LIBRARY)
$(call import-add-path, c:/cocos2d-x)
$(call import-add-path, c:/cocos2d-x/cocos2dx/platform/third_party/android/prebuilt)
$(call import-module, cocos2dx)
$(call import-module, external/Box2D)
Application.mk
APP_ABI := armeabi-v7a
APP_STL := gnustl_static
APP_OPTIM:= debug
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -g
NDK_TOOLCHAIN_VERSION := 4.8
im using a kindle fire with 2.3.3 installed
The obvious first answer is that make.exe (GNU Make) needs to be in your path. Is it installed in Cygwin? Check the Cygwin installer.

ndk-gdb error: device does not support the application's targetted CPU ABIs

Trying to run ndk-gdb and getting this error:
Android NDK installation path: /Library/AndroidSDK/ndk/
Using specific adb command: /Library/AndroidSDK/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.31
Using ADB flags:
Using auto-detected project path: .
Found package name: com.dev.project
jni/Android.mk:18: * Android NDK: Aborting. . Stop.
ABIs targetted by application: Android NDK:
Device API Level: 17
Device CPU ABIs: armeabi-v7a armeabi
ERROR: The device does not support the application's targetted CPU ABIs!
Device supports: armeabi-v7a armeabi
Package supports: Android NDK:
The 18th line in the jni/Android.mk is an import module call.
What does that mean and how to remedy it?
App is debuggable as per ndk documentation. I'm using Mac.
I can build and run the App, so build script should be fine.
Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libgl2jni
LOCAL_CFLAGS := -Werror -Wall -g
LOCAL_CPPFLAGS := -std=c++11
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../src $(LOCAL_PATH)/../../include $(LOCAL_PATH)/../../../boost
NDK_MODULE_PATH := $(LOCAL_PATH)/../../lib/ndk
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/../../src/*/*.cpp))
LOCAL_LDLIBS := -llog -lGLESv2
LOCAL_STATIC_LIBRARIES := freetype
include $(BUILD_SHARED_LIBRARY)
$(call import-module,otherlib) #commenting this line launches the ndk-gdb, but ndk-build fails
Application.mk
APP_STL := gnustl_static
#remove for release?
APP_ABI := armeabi armeabi-v7a
APP_OPTIM := debug
I had the same problem. I'm quite sure it is a bug in the core/build-local.mk script. At least the error message is not meaningful.
I fixed doing this:
export NDK_MODULE_PATH=path_to_look_for_modules
Where path_to_look_for_modules should be the parent directory of your module declared in the Android.mk. That is, if you have /myproject/mylibs/otherlib export the path /myproject/mylibs
If you have several paths, as usual:
export NDK_MODULE_PATH=path1:path2:path3
If you are building an Android app and have some ndk code you may be able to solve this problem by adding/modifying your Application.mk (usually in the jni directory) with the following line:
# The ARMv7 is significanly faster due to the use of the hardware FPU
APP_ABI := armeabi armeabi-v7a x86 mips
#APP_ABI := armeabi
APP_PLATFORM := android-10
I mean the APP_ABI line. This is specifying the target processors to compile the ndk code for. I am assuming from the error message that you are testing on a device that has a different cpu type than the ones you built the app for.
Useful information about third party libraries
Possible issue with makefile or environment
export NDK_PROJECT_PATH=[Path]
where [Path] is the parent of "jni" directory, which in turn contains your NDK code.
You "might" face this issue if your NDK code (jni directory) is located separately from your Android java code.
A common solution to this problem is to include this line in your Application.mk.
APP_ABI := armeabi-v7a
Replace armeabi-v7a by the appropriate API as per the Device supports line. This will ensure that your application is built for the correct platform, and that ndk-gdb can find it.

Categories

Resources