Dream_1018 2021-10-20 06:53 采纳率: 100%
浏览 72
已结题

Android Studio 生成apk包时报Build command failed.错误

原项目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.

展开全部

  • 写回答

6条回答 默认 最新

  • Dream_1018 2022-01-14 03:52
    关注

    最终解决方案,亲测可行。在build.gradle文件中
    修改arguments'NDK_DEBUG=0'为arguments'NDK_DEBUG=0 -o'
    修改arguments'NDK_DEBUG=1'为arguments'NDK_DEBUG=1 -o’

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)
编辑
预览

报告相同问题?

问题事件

  • 系统已结题 1月21日
  • 已采纳回答 1月14日
  • 创建了问题 10月20日

悬赏问题

  • ¥20 游戏mod是如何制作的
  • ¥15 关于#hadoop#的问题:按照老师上课讲的步骤写的
  • ¥20 有人会用这个工具箱吗 付fei咨询
  • ¥30 成都市武侯区住宅小区兴趣点
  • ¥15 Windows软实时
  • ¥15 自有服务器搭建网络隧道并且负载均衡
  • ¥15 opencv打开dataloader显示为nonetype
  • ¥15 MacOS 80端口外网无法访问
  • ¥50 js逆转反解密-会的来
  • ¥15 wrodpress如何调取数据库并展示
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部