gpt4 book ai didi

android - cocos2d-x Android构建失败

转载 作者:行者123 更新时间:2023-11-30 03:18:41 26 4
gpt4 key购买 nike

对不起,我不得不说Google Translator,因为我的英语说得不好。

我使用cocos compile -p android --android-studio命令构建了cocos2d-x项目。

我的开发环境:
操作系统= Windows10
cocos2d-x = 3.17.1
ndk = r11c
sdk = 27.0.3(android studio版本=最新(3.2.1))

如何解决此构建错误?

> Task :gamer:generateJsonModelDebug FAILED
Task ':gamer:generateJsonModelDebug' is not up-to-date because:
No history is available.
External native generate JSON debug: starting JSON generation
External native generate JSON debug: using platform version 16 for ABI
ARMEABI_V7A and min SDK version 16
External native generate JSON debug: rebuilding JSON C:\Development\cocos2d-
x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a\android_gradle_build.json due to:
External native generate JSON debug: - expected json C:\Development\cocos2d-
x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a\android_gradle_build.json file is not present, will remove stale json
folder
External native generate JSON debug: - missing previous command file
C:\Development\cocos2d-x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a\cmake_build_command.txt, will remove stale json folder
External native generate JSON debug: removing stale contents from
'C:\Development\cocos2d-x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a'
External native generate JSON debug: created folder 'C:\Development\cocos2d-
x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a'
External native generate JSON debug: executing cmake Executable :
C:\Development\sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
-HC:\Development\cocos2d-x-3.17.1\tools\cocos2d-console\bin\gamer
-BC:\Development\cocos2d-x-3.17.1\tools\cocos2d-

console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-16
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Development\cocos2d-x-
3.17.1\tools\cocos2d-



> Task :gamer:generateJsonModelDebug FAILED
Task ':gamer:generateJsonModelDebug' is not up-to-date because:
No history is available.
External native generate JSON debug: starting JSON generation
External native generate JSON debug: using platform version 16 for ABI
ARMEABI_V7A and min SDK version 16
External native generate JSON debug: rebuilding JSON C:\Development\cocos2d-
x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a\android_gradle_build.json due to:
External native generate JSON debug: - expected json C:\Development\cocos2d-
x-3.17.1\tools\cocos2d-
console\bin\gamer\proj.android\app\.externalNativeBuild\cmake\debug\armeabi-
v7a\android_gradle_build.json file is not present, will remove stale json
folder
External native generate JSON debug: - missing previous command file
C:\Development\cocos2d-x-3.17.1\tools\cocos2d-

console \ bin \ gamer \ proj.android \ app.externalNativeBuild \ cmake \ debug \ armeabi-
v7a \ cmake_build_command.txt,将删除陈旧的json文件夹
外部本机生成JSON调试:从中删除过时的内容
'C:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-
console \ bin \ gamer \ proj.android \ app.externalNativeBuild \ cmake \ debug \ armeabi-
v7a'
外部本机生成JSON调试:创建文件夹'C:\ Development \ cocos2d-
x-3.17.1 \ tools \ cocos2d-
console \ bin \ gamer \ proj.android \ app.externalNativeBuild \ cmake \ debug \ armeabi-
v7a'
外部本机生成JSON调试:执行cmake Executable:
C:\ Development \ sdk \ cmake \ 3.10.2.4988404 \ bin \ cmake.exe
参数:
-HC:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-console \ bin \ gamer
-BC:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-
console \ bin \ gamer \ proj.android \ app.externalNativeBuild \ cmake \ debug \ armeabi-
v7a
-DANDROID_ABI = armeabi-v7a
-DANDROID_PLATFORM =安卓-16
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY = C:\ Development \ cocos2d-x-
3.17.1 \ tools \ cocos2d-

console \ bin \ gamer \ proj.android \ app \ build \ intermediates \ cmake \ debug \ obj \ armeabi-
v7a
-DCMAKE_BUILD_TYPE =调试
-DANDROID_NDK = C:\ Development \ android-ndk-r11c
-DCMAKE_CXX_FLAGS = -frtti -fexceptions -fsigned-char
-DCMAKE_SYSTEM_NAME = Android
-DCMAKE_ANDROID_ARCH_ABI = armeabi-v7a
-DCMAKE_SYSTEM_VERSION = 16
-DCMAKE_EXPORT_COMPILE_COMMANDS = ON
-DCMAKE_ANDROID_NDK = C:\ Development \ android-ndk-r11c
-DCMAKE_TOOLCHAIN_FILE = C:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-
console \ bin \ gamer \ proj.android \ app.externalNativeBuild \ cmake \ debug \ armeabi-
v7a \ pre-ndk-r15-wrapper-android.toolchain.cmake
-G忍者
-DCMAKE_FIND_ROOT_PATH =
-DANDROID_STL = c++ _ static
-DANDROID_TOOLCHAIN =铛
-DANDROID_ARM_NEON = TRUE
jvmArgs:
[== "CMake Server" ==[

{“supportedProtocolVersions”:[{“isExperimental”:true,“major”:1,“minor”:1}],“type”:“hello”}

] ==“CMake Server” ==]

[==“CMake Server” == [

{
“type”:“握手”,
“cookie”:“gradle-cmake-cookie”,
“protocolVersion”:{
“isExperimental”:是的,
“主要”:1
“未成年人”:1
},
“sourceDirectory”:“C:/Development/cocos2d-x-3.17.1/tools/cocos2d-console/bin/gamer”,
“buildDirectory”:“C:/Development/cocos2d-x-3.17.1/tools/cocos2d-console/bin/gamer/proj.android/app/.externalNativeBuild/cmake/debug/armeabi-v7a”,
“发电机”:“忍者”
}

] ==“CMake Server” ==]

[==“CMake Server” == [

{“cookie”:“gradle-cmake-cookie”,“inReplyTo”:“握手”,“type”:“reply”}

] ==“CMake Server” ==]

[==“CMake Server” == [

{
“type”:“配置”,
“cacheArguments”:[
“”,
“-DANDROID_ABI \ u003darmeabi-v7a”,
“-DANDROID_PLATFORM \ u003dandroid-16”,
“-DCMAKE_LIBRARY_OUTPUT_DIRECTORY \ u003dC:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-console \ bin \ gamer \ proj.android \ app \ build \ intermediates \ cmake \ debug \ obj \ armeabi-v7a”,
“-DCMAKE_BUILD_TYPE \ u003dDebug”,
“-DANDROID_NDK \ u003dC:\ Development \ android-ndk-r11c”,
“-DCMAKE_CXX_FLAGS \ u003d-frtti -fexceptions -fsigned-char”,
“-DCMAKE_SYSTEM_NAME \ u003dAndroid”,
“-DCMAKE_ANDROID_ARCH_ABI \ u003darmeabi-v7a”,
“-DCMAKE_SYSTEM_VERSION \ u003d16”,
“-DCMAKE_EXPORT_COMPILE_COMMANDS \ u003dON”,
“-DCMAKE_ANDROID_NDK \ u003dC:\ Development \ android-ndk-r11c”,
“-DCMAKE_TOOLCHAIN_FILE \ u003dC:\ Development \ cocos2d-x-3.17.1 \ tools \ cocos2d-console \ bin \ gamer \ proj.android \ app \ .externalNativeBuild \ cmake \ debug \ armeabi-v7a \ pre-ndk-r15- wrapper-android.toolchain.cmake”,
“-G Ninja”,
“-DCMAKE_FIND_ROOT_PATH \ u003d”,
“-DANDROID_STL \ u003dc++ _ static”,
“-DANDROID_TOOLCHAIN \ u003dclang”,
“-DANDROID_ARM_NEON \ u003dTRUE”
]
}

] ==“CMake Server” ==]

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“configure”,“message”:“CMake错误在C:/Development/sdk/cmake/3.10.2.4988404/android.toolchain.cmake:356(消息):\ n无效的Android NDK修订版(应为12):11.2.2725575。\ n调用堆栈(最近调用优先):\ n proj.android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/pre-ndk-r15-wrapper -android.toolchain.cmake:2(包括)\ n C:/Development/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94(包括)\ n CMakeLists.txt:30(项目)\ n \ n“,” title“:”错误“,” type“:”消息“}

] ==“CMake Server” ==]

在C:/Development/sdk/cmake/3.10.2.4988404/android.toolchain.cmake:356(消息)的CMake错误:
无效的Android NDK修订版(应为12):11.2.2725575。
call 堆栈(最近的 call 优先):
proj.android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/pre-ndk-r15-wrapper-android.toolchain.cmake:2(包括)
C:/Development/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94(包括)
CMakeLists.txt:30(项目)

在C:/Development/sdk/cmake/3.10.2.4988404/android.toolchain.cmake:356的CMake错误:(消息):
无效的Android NDK修订版(应为12):11.2.2725575。
call 堆栈(最近的 call 优先):
proj.android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/pre-ndk-r15-wrapper-android.toolchain.cmake:2(包括)
C:/Development/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94(包括)
CMakeLists.txt:30(项目)

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“configure”,“message”:“CMake错误:CMake无法找到与\” Ninja \“相对应的构建程序。未设置CMAKE_MAKE_PROGRAM。您可能需要选择其他构建工具。“,” title“:”错误“,” type“:”消息“}

] ==“CMake Server” ==]

CMake错误:CMake无法找到与“Ninja”相对应的构建程序。 CMAKE_MAKE_PROGRAM未设置。您可能需要选择其他构建工具。
CMake错误:CMake无法找到与“Ninja”相对应的构建程序。 CMAKE_MAKE_PROGRAM未设置。您可能需要选择其他构建工具。

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“配置”,“消息”:“CMake错误:未设置CMAKE_C_COMPILER,在EnableLanguage”之后,“标题”:“错误”,“类型”:“消息”}

] ==“CMake Server” ==]

CMake错误:EnableLanguage之后未设置CMAKE_C_COMPILER
CMake错误:EnableLanguage之后未设置CMAKE_C_COMPILER

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“配置”,“消息”:“CMake错误:未设置CMAKE_CXX_COMPILER,在EnableLanguage”之后,“标题”:“错误”,“类型”:“消息”}

] ==“CMake Server” ==]

CMake错误:EnableLanguage之后未设置CMAKE_CXX_COMPILER
CMake错误:EnableLanguage之后未设置CMAKE_CXX_COMPILER

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“configure”,“progressCurrent”:1000,“progressMaximum”:1000,“progressMessage”:“Configuring”,“progressMinimum”:0,“type”:“progress”}

] ==“CMake Server” ==]

[==“CMake Server” == [

{“cookie”:“”,“inReplyTo”:“configure”,“message”:“配置不完整,发生错误!”,“type”:“message”}

] ==“CMake Server” ==]

配置不完整,发生错误!
配置不完整,发生错误!

[==“CMake Server” == [

{“cookie”:“”,“errorMessage”:“配置失败。”,“inReplyTo”:“配置”,“类型”:“错误”}

] ==“CMake Server” ==]

配置失败。
外部本机生成JSON调试:JSON生成完成但出现问题

:gamer:generateJsonModelDebug(线程[用于':'线程7,5,main的任务 worker )已完成。花费了0.2秒

Task :libcocos2dx:platformAttrExtractor Task ':libcocos2dx:platformAttrExtractor' is not up-to-date because: No history is available.



:libcocos2dx:platformAttrExtractor(线程[用于':'线程5,5,主线程的任务 worker )已完成。花费了0.232秒
FAILURE: Build failed with an exception.
  • 出了什么问题:
    任务':gamer:generateJsonModelDebug'的执行失败。

    com.android.ide.common.process.ProcessException: Error configuring

  • 尝试:
    使用--stacktrace选项运行以获取堆栈跟踪。使用--debug选项运行,以获取更多日志输出。与--scan一起运行以获得完整的见解。
  • https://help.gradle.org上获得更多帮助

  • 在21秒钟内失败
    21个可执行任务:21个已执行
    运行命令错误,返回代码:1。

    我怎么了

    最佳答案

    CMake Error: CMake was unable to find a build program corresponding to "Ninja".



    使用CMake跨平台构建系统生成 cocos2d-x 3.17.1(默认情况下)。

    Google通常会通过在SDK中自动下载来升级缺少的依赖项。
    例如CMake已从 3.6升级到 3.10(最新的cMake要求使用忍者)。

    因此您必须 在系统中安装Ninja。
  • 如果您是Windows系统用户,请使用download and extract Ninja.exe并在环境路径中进行设置。
  • 如果您是MacOS用户,则可以通过brew来install ninja in your system

  • 希望这能解决您的问题。

    关于android - cocos2d-x Android构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54500937/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com