原项目gradle版本是3.1.0,生成apk包时没任何问题,后面因需求提升到 4.2.1后,生成apk包时报下面错误
Execution failed for task ':PyGame:externalNativeBuildRelease'.
Build command failed.
Error while executing process E:\ndk\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Android.mk NDK_APPLICATION_MK=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-21 NDK_OUT=F:/GameComm/proj_TongC2/TongCHuaWei/PyGame/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=clang -j8 NDK_MODULE_PATH=F:/GameComm/proj_TongC2/cocos2d;F:/GameComm/proj_TongC2/cocos2d/cocos;F:/GameComm/proj_TongC2/cocos2d/external NDK_DEBUG=0 MyGame}
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
执行 Run with --info 后如下日志
Starting process 'command 'E:\ndk\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd''. Working directory: F:\GameComm\proj_TongC2\TongCHuaWei\PyGame Command: E:\ndk\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Android.mk NDK_APPLICATION_MK=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-21 NDK_OUT=F:/GameComm/proj_TongC2/TongCHuaWei/PyGame/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=clang -j8 NDK_MODULE_PATH=F:/GameComm/proj_TongC2/cocos2d;F:/GameComm/proj_TongC2/cocos2d/cocos;F:/GameComm/proj_TongC2/cocos2d/external NDK_DEBUG=0 MyGame
Successfully started process 'command 'E:\ndk\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd''
make: *** No rule to make target `MyGame'. Stop.
:PyGame:externalNativeBuildRelease (Thread[Execution worker for ':' Thread 6,5,main]) completed. Took 1.309 secs.
:PyGame:compileReleaseJavaWithJavac (Thread[Execution worker for ':' Thread 6,5,main]) started.
Execution failed for task ':PyGame:externalNativeBuildRelease'.
Build command failed.
Error while executing process E:\ndk\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Android.mk NDK_APPLICATION_MK=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-21 NDK_OUT=F:/GameComm/proj_TongC2/TongCHuaWei/PyGame/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=F:\GameComm\proj_TongC2\TongCHuaWei\PyGame\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=clang -j8 NDK_MODULE_PATH=F:/GameComm/proj_TongC2/cocos2d;F:/GameComm/proj_TongC2/cocos2d/cocos;F:/GameComm/proj_TongC2/cocos2d/external NDK_DEBUG=0 MyGame}
- Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.