编译LOCAL_SRC_FILES时Cocos2d-x错误指向缺少的文件(和文件夹)Windows

Lov*_*era 5 android android-ndk cocos2d-android

晚上好.

我试图使用cocos2d-x编译HelloWorld.我使用了以下命令:

  • cocos compile -p android --android-studio
  • cocos compile -p android --android-studio
  • cocos compile -p android

我总是有同样的答案

Android NDK: ERROR:C:\Users\santi_000\Desktop\Android\cocos2d\HelloWorld\proj.android\../cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to the missing file
Android NDK: Check que C:/Users/santi_000/Desktop/Android/cocos2d/HelloWorld/proj.android/../cocos2d/external/freetype2/prebuilt/android/arm64-v8a/libfreetype.a exists or que its path is correct
make: Entering directory `C: /Users/santi_000/Desktop/Android/cocos2d/HelloWorld/proj.android '
C: / Users / santi_000 / AppData / Local / Android / sdk / ndk-bundle / build //../ build / core / prebuilt-library.mk: 45: *** Android NDK: Aborting. Stop.
make: Leaving directory `C: /Users/santi_000/Desktop/Android/cocos2d/HelloWorld/proj.android '
Error running command, return code: 2.
Run Code Online (Sandbox Code Playgroud)

我在StackOverFlow中找到了一些页面但是没有一个帮助过我.我正在使用Windows.我意识到我甚至没有arm64-V8A文件夹,我该怎么办?我可以在哪里复制它,或者我如何生成它?

谢谢.

Ana*_*and 10

以下对我有用

cocos compile --android-studio --target android-22 
    --ap android-22 --ndk-mode debug --ndk-toolchain arm-linux-androideabi-4.9 
    --platform android --app-abi armeabi --src C:\cocos2d-x\tests\cpp-tests
Run Code Online (Sandbox Code Playgroud)

您需要更换--ndk-toolchainNDK安装附带的正确版本.检查NDK_ROOT内的toolchains文件夹.

实际上最重要的一个就是--app-abi armeabi使用的工具链.

[编辑]如果您确实检查过,cocos compile -h您会看到--app-abi提到armeabi默认值.但事实并非如此.它正在arm64成为默认值.