NDK недопустимый параметр — недопустимый параметр — N недопустимый параметр — O

#android #android-ndk

#Android #android-ndk

Вопрос:

Я пытался создать проект NDK с помощью библиотеки opencv, но я получил эти ошибки:

 Build command failed.
Error while executing process E:SoftWareAndroidandroid-ndk-r19cndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:Users127051DocumentsStudioProjectsStudioProjectsImageProccessingappsrcmaincppAndroid.mk NDK_APPLICATION_MK=C:Users127051DocumentsStudioProjectsStudioProjectsImageProccessingappsrcmaincppApplication.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-24 NDK_OUT=C:/Users/127051/Documents/StudioProjects/StudioProjects/ImageProccessing/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:Users127051DocumentsStudioProjectsStudioProjectsImageProccessingappbuildintermediatesndkBuilddebuglib APP_CPPFLAGS =-std=c  14 -DANDROID_STL=gnustl_static APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

E:SoftWareAndroidandroid-ndk-r19cbuild\..prebuiltwindows-x86_64binmake: invalid option -- A
E:SoftWareAndroidandroid-ndk-r19cbuild\..prebuiltwindows-x86_64binmake: invalid option -- N
E:SoftWareAndroidandroid-ndk-r19cbuild\..prebuiltwindows-x86_64binmake: invalid option -- O
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from commands.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any commands; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no commands; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo commands.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.

This program built for i686-w64-mingw32
Report bugs to <bug-make@gnu.org>
  

это project gradle :

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.idin.imageproccessing"
        minSdkVersion 24
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        externalNativeBuild {
            ndkBuild{
                arguments '-DANDROID_STL=gnustl_static'
                cppFlags "-std=c  14"
            }
            cmake {
                arguments '-DANDROID_STL=gnustl_static'
                cppFlags "-std=c  14"
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable = true
            jniDebuggable true
        }
    }
    externalNativeBuild {
        ndkBuild {
            path 'src/main/cpp/Android.mk'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
    implementation project(':openCVLibrary345')
}
  

это файлы mk :
Application.mk

 APP_ABI := arm64-v8a
APP_CPPFLAGS := -frtti -fexceptions
APP_PLATFORM := android-24
  

Android.mk

 LOCAL_PATH := $(call my-dir)
PROJECT_ROOT:= $(call my-dir)/../../../../..

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=on
include E:/OldNoteBook/SoftWare/Android/opencv-3.4.5-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := libopencv_ndk
LOCAL_CFLAGS    := -Werror -Wno-write-strings -std=c  14
LOCAL_SRC_FILES := native-lib.cpp 
                   CV_Main.cpp 
                   Native_Camera.cpp 
                   Image_Reader.cpp
LOCAL_LDLIBS    := -llog -lmediandk -lcamera2ndk
include $(BUILD_SHARED_LIBRARY)
  

как я могу исправить эту ошибку?
как удалить эти параметры?

Сведения об окружающей среде:

Версия NDK: r19c

Операционная система хоста: Windows

IDE: Android Studio 3.3.2

Инструменты платформы SDK: 28.0.2

Инструменты SDK: 25.2.5

Ответ №1:

 arguments '-DANDROID_STL=gnustl_static'
  

Это недопустимо. Вам нужно APP_STL=gnustl_static .

Комментарии:

1. Я изменил это, но не исправил.