How to fix process_begin: CreateProcess(NULL, “”, …) failed error

旧城冷巷雨未停 提交于 2021-02-08 09:51:08

问题


I am trying to run this project phimp.me.I have used c++_static as per the new document mentioned in android supporting C++ library, still it throws the same error. I have tried cleaning and rebuilding the project, replacing c++_static with c++_shared but its throws the same error. Also I tried renaming the OpenCV.mk file to OpenCVX86.mk file as per one link. I have rechecked and downloaded NDK and CMake from SDK Tools but its stuck with the same error.

Android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=off
OPENCV_LIB_TYPE := STATIC
include $(LOCAL_PATH)/OpenCV.mk

LOCAL_MODULE    := nativeimageprocessing

LOCAL_CFLAGS := -DANDROID_NDK \
                -DDISABLE_IMPORTGL

LOCAL_SRC_FILES := main_processing.cpp enhance.cpp filters.cpp colour_space.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_LDLIBS    += -lm -llog

include $(BUILD_SHARED_LIBRARY)

Application.mk file

APP_STL := c++_static
APP_OPTIM := release
APP_ABI := armeabi-v7a
APP_CPPFLAGS := -frtti -fexceptions
APP_PLATFORM := android-25

Error

Build command failed.


Error while executing process C:\Users\satyasarathim\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\Workshop\phimpme-android-development\app\src\main\jni\Android.mk NDK_APPLICATION_MK=D:\Workshop\phimpme-android-development\app\src\main\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-17 NDK_OUT=D:/Workshop/phimpme-android-development/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=D:\Workshop\phimpme-android-development\app\build\intermediates\ndkBuild\release\lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


process_begin: CreateProcess(NULL, "", ...) failed.


*** Android NDK: APP_STL c++_static is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information.    .  Stop.

回答1:


Its work for me by this instruction:

Redirect to ndk directory and open ndk-build.cmd file and remove this line

%~dp0\build\ndk-build.cmd %*

really its work for me

of this link: https://github.com/facebook/fresco/issues/47




回答2:


I'm really not sure how you got that error. I cloned the project and followed the instructions in the README. I got a lot of errors because the project is using an ancient gradle plugin, but those were easily fixed: https://github.com/fossasia/phimpme-android/pull/2684

However, even after dealing with most of those issues, it turns out the project still can't be built with NDK r18 or newer because the project contains prebuilt OpenCV libraries that are built against gnustl. gnustl and libc++ are not ABI compatible, so they cannot be used with libc++, which is the only option in r18+.

Your options for fixing that are:

  1. Rebuild the OpenCV libraries against libc++.
  2. Use NDK r17.



回答3:


On Windows, use the 64-bit NDK instead of 32-bit - this worked for me (verified in r16b)



来源:https://stackoverflow.com/questions/54404007/how-to-fix-process-begin-createprocessnull-failed-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!