Android NDK error. Could not build project

I get the following error indicated:

E:\SDK\ndk-bundle\build\core\setup-app-platform.mk 

Error: (115) *** Android NDK: Cancel. Stop. Error: execution completed for task ': un7zip: compileReleaseNdk'.

com.android.ide.common.process.ProcessException: error while executing process E: \ sdk \ ndk-bundle \ ndk-build.cmd with arguments {NDK_PROJECT_PATH = null APP_BUILD_SCRIPT = E: \ appRizort \ RizortCardboard \ un7zip \ build \ intermediates \ ndk \ release \ Android.mk APP_PLATFORM = android-25 NDK_OUT = E: \ appRizort \ RizortCardboard \ un7zip \ build \ intermediates \ ndk \ release \ obj NDK_LIBS_OUT = E: \ appRizort \ RizortCardboard \ un7zip \ build \ intermediates n release \ lib APP_ABI = armeabi-v7a, armeabi, x86, arm64-v8a}

+5
source share
2 answers

Your NDK_PROJECT_PATH is NULL, if your project folder path contains a space, this may cause this problem.

+4
source

APP_PLATFORM that you specify when creating your own part of your project using the NDK is very important. The story is described in detail in the NDK manual :

This variable contains the minimum version of the Android platform that you want to support. For example, a value of android-15 indicates that your library uses APIs that are not available under Android 4.0.3 (API level 15) and cannot be used on devices with a lower version of the platform. See the NDK Native API for a complete list of Android platform names and corresponding system images.

Instead of directly changing this flag, you should set the minSdkVersion property in the defaultConfig or productFlavors your module at the level of the build.gradle file . This ensures that your library is only used by applications installed on devices with the appropriate version of Android. The ndk-build toolchain uses the following logic to select the minimum platform version for your library based on the ABI and minSdkVersion you created that you specify:

  • If there is a platform version for ABI equal to minSdkVersion , ndk-build uses this version.
  • Otherwise, if there are platform versions below minSdkVersion for ABI, ndk-build uses the highest of these platform versions. This is a smart choice because a missing version of the platform usually means that there were no changes with the previous available version of the platform APIs.
  • Otherwise, ndk-build uses the next available version of the platform above minSdkVersion .

NDK does not have a separate android-25 platform. You can choose android-24 or (with beta version of r15), android-26 if your minimum supported platform is O. If your minSdkVersion smaller or, if in doubt, choose a lower platform for NDK, since NDK platforms are compatible.

+2
source

Source: https://habr.com/ru/post/1268701/


All Articles