2017-06-09 37 views
5

otrzymuję następujący określony błąd,Błąd Android NDK. Nie jest w stanie zbudować projekt

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

błąd: (115) *** Android NDK: Przerywanie. Zatrzymać. Błąd: Wykonanie nie powiodło się dla zadania ": 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\ndk\release\lib APP_ABI=armeabi-v7a,armeabi,x86,arm64-v8a}

+0

NDK nie obsługuje platformy ** Android-25 **. Możesz ustawić ** android-24 ** lub (z r15 beta) ** android-26 **. –

+1

Tak, to zadziałało. Dzięki. @AlexCohn –

+0

Nawet z Androidem-26, otrzymuję NDK_PROJECT_PATH jako null w Android Studio. Jeśli jednak uruchomię go z wiersza polecenia, kompilacja działa poprawnie. – RisingUp

Odpowiedz

4

Twój NDK_PROJECT_PATH jest null, jeśli ścieżka do folderu projektu zawiera white-space, może powodować ten problem.

+0

Nie ma białych znaków –

+0

'NDK_PROJECT_PATH' ma wartość null, gdy ** ndk-build ** jest uruchamiany przez wtyczkę gradle Android w Android Studio, jest to koszerne. –

2

APP_PLATFORM, które określasz przy tworzeniu natywnej części projektu za pomocą NDK, jest bardzo ważne. Fabuła jest described at length in the NDK guide:

This variable contains the minimum Android platform version you want to support. For example, a value of android-15 specifies that your library uses APIs that are not available below Android 4.0.3 (API level 15) and can't be used on devices running a lower platform version. For a complete list of platform names and corresponding Android system images, see Android NDK Native APIs .

Instead of changing this flag directly, you should set the minSdkVersion property in the defaultConfig or productFlavors blocks of your module-level build.gradle file . This makes sure your library is used only by apps installed on devices running an adequate version of Android. The ndk-build toolchain uses the following logic to choose the minimum platform version for your library based the ABI you're building and the minSdkVersion you specify:

  1. If there exists a platform version for the ABI equal to minSdkVersion , ndk-build uses that version.
  2. Otherwise, if there exists platform versions lower than minSdkVersion for the ABI, ndk-build uses the highest of those platform versions. This is a reasonable choice because a missing platform version typically means that there were no changes to the native platform APIs since the previous available version.
  3. Otherwise, ndk-build uses the next available platform version higher than minSdkVersion .

NDK nie posiada oddzielną platformę android-25. Możesz wybrać opcję android-24 lub (z r15 beta), android-26, jeśli minimalna obsługiwana platforma to O. Jeśli Twój minSdkVersion jest mniejszy lub jeśli masz wątpliwości, wybierz niższą platformę dla NDK, ponieważ platformy NDK są kompatybilne w górę.