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:
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
to
LOCAL_MODULE := cocos2dcpp
LOCAL_MODULE_FILENAME := libcocos2dcpp
Hope it helps anyone who had migrated an old project to gradle in the past (way before 3.17)