任务执行失败':app:externalNativeBuildDebug'

时间:2017-01-23 11:01:40

标签: android android-ndk

我正在构建一个支持c ++代码的android应用程序。当我尝试构建应用程序时,我收到以下错误

chcp.bat

这是我的Android.mk文件内容     LOCAL_PATH:= $(调用my-dir)

    Error:'C:\Users\R' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    'C:\Users\R' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    make: *** [clean-ObjectRecognition-armeabi] Error 1

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:externalNativeBuildCleanDebug'.
    > Build command failed.
    Error while executing 'E:\Android\AndroidSDK\SDK\ndk-bundle\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=E:\Android\Aditya\poc\ObjectRecognition\app\src\main\jni\Android.mk NDK_APPLICATION_MK=E:\Android\Aditya\poc\ObjectRecognition\app\src\main\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDEBUG=1 APP_PLATFORM=android-19 NDK_OUT=E:/Android/Aditya/poc/ObjectRecognition/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=E:\Android\Aditya\poc\ObjectRecognition\app\build\intermediates\ndkBuild\debug\lib clean}
    Android NDK: WARNING:E:\Android\Aditya\poc\ObjectRecognition\app\src\main\jni\Android.mk:ObjectRecognition: non-system libraries in linker flags: -lopencv_java    
    Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
    Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
    Android NDK:     current module    
    'C:\Users\R' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    'C:\Users\R' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    make: *** [clean-ObjectRecognition-armeabi] Error 1


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

我已将ObjectRecognition.cpp和androidmk一起放在app->中; SRC-> main-> JNI

我需要做些什么才能解决此错误。

编辑1: 我在终端

中运行了这个命令
include $(CLEAR_VARS)

include E:/Android/OpenCV-2.4.10-android-sdk/OpenCV-2.4.10-android-    sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := ObjectRecognition
LOCAL_SRC_FILES := ObjectRecognition.cpp
LOCAL_LDLIBS +=  -llog -ldl

include $(BUILD_SHARED_LIBRARY)

我得到了这个输出

E:\Android\Aditya\poc\ObjectRecognition>ndk-build NDK_PROJECT_PATH=null     APP_BUILD_SCRIPT=E:\Android\Aditya\poc\ObjectRecognition\app\src\main\jni\Android.mk NDK_APPLICATION_MK=E:\Android\Aditya\poc\ObjectRecognition\app\src\main\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDEBUG=1 APP_PLATFORM=android-19 NDK_OUT=E:/Android/Aditya/poc/ObjectRecognition/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=E:\Android\Aditya\poc\ObjectRecognition\app\build\intermediate\ndkBuild\debug\lib clean NDK_LOG=1

C:\ users \ R不是我登录的用户。我的用户名是R& D -2。

0 个答案:

没有答案