【求助】Cocos2dx 3.16在Android Studio4.1.2 上无法编译运行

由于项目的需要,我使用Cocos2dx 3.16创建新项目,iOS可以正常编译运行起来了。
但是 Android折腾了很久都无法编译运行,悲剧。
我的环境: MacOS 10.15.7
Andorid Studio: 4.1.2
NDK: 专门下载了r14b

实现步骤:
1、cd {Cocos2dx3.16目录}
2、cocos 创建新cpp项目
3、打开AS ,导入 proj.android-studio
4、构建、编译。

然后各种报错:
1、ndk.dir 指定
2、升级gradle版本
3、追加google()
4、SDK Build ToolsVersion 更改
……

最后,贴一部分错误信息,供参考,请大侠指点!

Task :libcocos2dx:mergeDebugShaders
Task :libcocos2dx:mergeDebugShaders in libcocos2dx Starting
Caching disabled for task ‘:libcocos2dx:mergeDebugShaders’ because:
Build cache is disabled
Task ‘:libcocos2dx:mergeDebugShaders’ is not up-to-date because:
Output property ‘incrementalFolder’ file /Users/mayici/Cocos2dx-Prjs/Test316/cocos2d/cocos/platform/android/libcocos2dx/build/intermediates/incremental/mergeDebugShaders has been removed.
Output property ‘incrementalFolder’ file /Users/mayici/Cocos2dx-Prjs/Test316/cocos2d/cocos/platform/android/libcocos2dx/build/intermediates/incremental/mergeDebugShaders/merger.xml has been removed.
Output property ‘outputDir’ file /Users/mayici/Cocos2dx-Prjs/Test316/cocos2d/cocos/platform/android/libcocos2dx/build/intermediates/merged_shaders/debug/out has been removed.
The input changes require a full rebuild for incremental task ‘:libcocos2dx:mergeDebugShaders’.
Unable do incremental execution: full task run
Task :libcocos2dx:mergeDebugShaders in libcocos2dx Finished
:libcocos2dx:mergeDebugShaders (Thread[Execution worker for ‘:’ Thread 2,5,main]) completed. Took 0.004 secs.
:libcocos2dx:compileDebugShaders (Thread[Execution worker for ‘:’ Thread 2,5,main]) started.

用as3.5.2呗!
image
image

是不想把 as 降级……
谢谢你,实在不行,只能降级了……

我用4.13都没事,你百度:Build cache is disabled 试试看,build目录都删了

没能解决,你的NDK版本是什么? 我的版本是20.0.5594570

我也是14,这应该跟NDK没关系,好像是as的gradle版本太高跟什么东西不兼容
我用 classpath ‘com.android.tools.build:gradle:3.1.0’,你可以试试

你可以升级到最新的3.17.2版本或使用github上的V3库
AS和gradle使用最新的都没问题(可能需要稍微修改下)
NDK:image

image

image