Have you tried Android Gradle plugin v3.5.1, along with with Gradle version 5.4.1? You may need to delete all build and cache folders if you’ve built it previously, otherwise you get some really strange errors. Other than that, it’s building and creating the APK fine for my own project.
It’s hard to tell from the error message you provided, I’m building with gradle 3.5.0 under cocos2d-x 3.17.2 without any error. Try ‘Sync project with gradle files’ button on the right top corner.
I have indeed cleared out builds and intermediates and tried 3.5.1 instead of 3.5.0 to no avail.
I know it is an error that doesn’t give much information but based on the linked topic it is happening to numerous others.
I hope to at least leave this topic open to anyone experiencing the issue that might find a fix (that isn’t downgrading)
What is the PROP_BUILD_TYPE set to in gradle.properties?
The cocos2dcpp library or file does not exist anywhere in the Cocos2d-x build files, so it’s definitely something in your build scripts that’s causing the issue. Search for it yourself in all *txt, *.mk, *.gradle files, and if you do find it, then you would have found your problem.
According to the build setup topic libcocos2dcpp is treated as cocos2dcpp in the gradle config.
This works correctly with Gradle 3.4.X but seems to not do so with 3.5.X
Thanks, I took a look at this and compared the setup for current v3.17 code but there wasn’t much difference bar the platform checks and I didn’t find anything useful.
I dug really far into this and resolved it by chance, it appears that pre-3.5.0 it was acceptable to specify the ndkBuild target as targets 'cocos2dcpp' while in the Android.mk specifying the LOCAL_MODULE as cocos2dcpp_shared.
This however stopped working in 3.5.0 and the following change fixes the build: