Android NDK Build命令无法识别错误

时间:2017-10-04 13:29:11

标签: android android-ndk

我正在使用ndk为我的应用程序构建libopus但是当我构建时,我收到此错误:

 Error:Note: D:\VoiceRecorderCopy(7)\opuslib\src\main\java\top\oply\opuslib\OpusPlayer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':opuslib:externalNativeBuildRelease'.
> Build command failed.
Error while executing process C:\Users\we\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\VoiceRecorderCopy(7)\opuslib\src\main\jni\Android.mk NDK_APPLICATION_MK=D:\VoiceRecorderCopy(7)\opuslib\src\main\jni\Application.mk APP_ABI=mips64 NDK_ALL_ABIS=mips64 NDK_DEBUG=0 APP_PLATFORM=android-21 NDK_OUT=D:/VoiceRecorderCopy(7)/opuslib/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=D:\VoiceRecorderCopy(7)\opuslib\build\intermediates\ndkBuild\release\lib D:/VoiceRecorderCopy(7)/opuslib/build/intermediates/ndkBuild/release/obj/local/mips64/libopustool.so}
[mips64] Compile        : opustool <= bands.c
[mips64] Compile        : opustool <= celt.c
[mips64] Compile        : opustool <= celt_encoder.c
[mips64] Compile        : opustool <= celt_decoder.c
[mips64] Compile        : opustool <= cwrs.c
[mips64] Compile        : opustool <= entcode.c
[mips64] Compile        : opustool <= entdec.c
[mips64] Compile        : opustool <= entenc.c
[mips64] Compile        : opustool <= kiss_fft.c
[mips64] Compile        : opustool <= laplace.c
[mips64] Compile        : opustool <= mathops.c
[mips64] Compile        : opustool <= mdct.c
[mips64] Compile        : opustool <= modes.c
[mips64] Compile        : opustool <= pitch.c
[mips64] Compile        : opustool <= celt_lpc.c
[mips64] Compile        : opustool <= quant_bands.c
[mips64] Compile        : opustool <= rate.c
[mips64] Compile        : opustool <= vq.c
'D:\VoiceRecorderCopy' is not recognized as an internal or external command,
operable program or batch file.
make: *** [D:/VoiceRecorderCopy(7)/opuslib/build/intermediates/ndkBuild/release/obj/local/mips64/objs/opustool/celt/arm/armcpu.o] Error 1


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

这是我在build.gradle中定义的方式:

task ndkBuild(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine 'C:\\Users\\we\\AppData\\Local\\Android\\sdk\\ndk-bundle\\ndk-build.cmd', '-C', file('src/main/jni').absolutePath
    } else {
        commandLine 'C:\\Users\\we\\AppData\\Local\\Android\\sdk\\ndk-bundle\\ndk-build', '-C', file('src/main/jni').absolutePath
    }
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}

externalNativeBuild {
    ndkBuild {
        path 'src/main/jni/Android.mk'
    }
}

请帮我解决这个问题。它说该命令无法识别,但我不知道在哪里编辑此命令。 这是Android.mk文件:

 LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

#include the .mk files
include $(LOCAL_PATH)/celt_sources.mk
include $(LOCAL_PATH)/silk_sources.mk
include $(LOCAL_PATH)/opus_sources.mk

MY_MODULE_DIR       := opustool

LOCAL_MODULE        := $(MY_MODULE_DIR)

#float point sources
SILK_SOURCES += $(SILK_SOURCES_FLOAT)
OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
#ARM build
CELT_SOURCES += $(CELT_SOURCES_ARM)
SILK_SOURCES += $(SILK_SOURCES_ARM)
LOCAL_SRC_FILES     := \
$(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)

LOCAL_LDLIBS        := -lm -llog

LOCAL_C_INCLUDES    := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/silk \
$(LOCAL_PATH)/silk/float \
$(LOCAL_PATH)/celt
LOCAL_CFLAGS        := -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow
LOCAL_CFLAGS        := -DNULL=0 -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS        += -DOPUS_BUILD -DHAVE_CONFIG_H -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O2 -std=gnu99 -g 
#LOCAL_CPPFLAGS      := -DBSD=1
#LOCAL_CPPFLAGS      += -ffast-math -O3 -funroll-loops

include $(BUILD_SHARED_LIBRARY)

这是Application.mk文件:

APP_ABI  := all
APP_CFLAGS := -std=gnu99

0 个答案:

没有答案