Hey sorry for inconvenience but currently i switched to cmake build. and i face below error
Build command failed.
Error while executing process /Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/cmake/3.10.2.4988404/bin/cmake with arguments {--build /Users/ArmoredTechnoSolution/Desktop/cocos2d-x-3.17.2/NEW_PROJECTS_DIR/MyGame/proj.android/app/.externalNativeBuild/cmake/debug/x86 --target MyGame}
[1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/x86/libMyGame.so
FAILED: ../../../../build/intermediates/cmake/debug/obj/x86/libMyGame.so
: && /Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=i686-none-linux-android16 --gcc-toolchain=/Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -frtti -fexceptions -fsigned-char -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libMyGame.so -o ../../../../build/intermediates/cmake/debug/obj/x86/libMyGame.so CMakeFiles/MyGame.dir/Classes/AppDelegate.cpp.o CMakeFiles/MyGame.dir/Classes/HelloWorldScene.cpp.o CMakeFiles/MyGame.dir/proj.android/app/jni/hellocpp/main.cpp.o -Wl,--whole-archive engine/cocos/platform/libcpp_android_spec.a -Wl,--no-whole-archive lib/libcocos2d.a lib/libexternal.a ../../../../../../cocos2d/external/Box2D/prebuilt/android/x86/libbox2d.a ../../../../../../cocos2d/external/chipmunk/prebuilt/android/x86/libchipmunk.a ../../../../../../cocos2d/external/freetype2/prebuilt/android/x86/libfreetype.a lib/libext_recast.a ../../../../../../cocos2d/external/jpeg/prebuilt/android/x86/libjpeg.a ../../../../../../cocos2d/external/webp/prebuilt/android/x86/libwebp.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libLinearMath.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libBulletDynamics.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libBulletCollision.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libLinearMath.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libBulletMultiThreaded.a ../../../../../../cocos2d/external/bullet/prebuilt/android/x86/libMiniCL.a ../../../../../../cocos2d/external/tiff/prebuilt/android/x86/libtiff.a ../../../../../../cocos2d/external/websockets/prebuilt/android/x86/libwebsockets.a ../../../../../../cocos2d/external/uv/prebuilt/android/x86/libuv_a.a ../../../../../../cocos2d/external/openssl/prebuilt/android/x86/libssl.a ../../../../../../cocos2d/external/openssl/prebuilt/android/x86/libcrypto.a lib/libext_tinyxml2.a lib/libext_xxhash.a lib/libext_xxtea.a lib/libext_clipper.a lib/libext_edtaa3func.a lib/libext_convertUTF.a lib/libext_poly2tri.a lib/libext_md5.a ../../../../../../cocos2d/external/curl/prebuilt/android/x86/libcurl.a ../../../../../../cocos2d/external/png/prebuilt/android/x86/libpng.a engine/external/android-specific/cpufeatures/libext_cpufeatures.a -ldl lib/libext_pvmp3dec.a lib/libext_tremolo.a ../../../../../../cocos2d/external/zlib/prebuilt/android/x86/libz.a lib/libext_unzip.a -lGLESv2 -lEGL -llog -landroid -lOpenSLES -latomic -lm && :
../../../../../../Classes/HelloWorldScene.cpp:222: error: undefined reference to 'AdmobHelper::exitDialog()'
../../../../../../Classes/HelloWorldScene.cpp:282: error: undefined reference to 'AdmobHelper::getScale_View()'
../../../../../../Classes/Baby_setting_panel.h:18: error: undefined reference to 'vtable for Baby_setting_panel'
/Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../../../../../../Classes/LanguageSelection.h:19: error: undefined reference to 'vtable for LanguageSelection'
/Users/ArmoredTechnoSolution/Desktop/Armored/Android_Software/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: the vtable symbol may be undefined because the class is missing its key function
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
I’m using cocos2d-x-3.17.2 and android studio 3.4.1NDK r20
Let me know which things i need to change in cMake
#/****************************************************************************
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2015-2017 Chukong Technologies Inc.
#
# http://www.cocos2d-x.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ****************************************************************************/
cmake_minimum_required(VERSION 3.6)
set(APP_NAME MyGame)
project(${APP_NAME})
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cocos2d)
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
# record sources, headers, resources...
set(GAME_SOURCE)
set(GAME_HEADER)
set(GAME_RES_FOLDER
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
)
if(APPLE OR WINDOWS)
cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
# add cross-platforms source files and header files
list(APPEND GAME_SOURCE
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
)
list(APPEND GAME_HEADER
Classes/AppDelegate.h
Classes/HelloWorldScene.h
)
if(ANDROID)
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
set(APP_NAME MyGame)
list(APPEND GAME_SOURCE
proj.android/app/jni/hellocpp/main.cpp
)
elseif(LINUX)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
list(APPEND GAME_HEADER
proj.win32/main.h
proj.win32/resource.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
proj.win32/game.rc
${common_res_files}
)
elseif(APPLE)
if(IOS)
list(APPEND GAME_HEADER
proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreen.storyboard
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m
proj.ios_mac/ios/AppController.mm
proj.ios_mac/ios/RootViewController.mm
proj.ios_mac/ios/Prefix.pch
${APP_UI_RES}
)
elseif(MACOSX)
set(APP_UI_RES
proj.ios_mac/mac/Icon.icns
proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
proj.ios_mac/mac/main.cpp
proj.ios_mac/mac/Prefix.pch
${APP_UI_RES}
)
endif()
list(APPEND GAME_SOURCE ${common_res_files})
endif()
# mark app complie info and libs info
set(all_code_files
${GAME_HEADER}
${GAME_SOURCE}
)
if(NOT ANDROID)
add_executable(${APP_NAME} ${all_code_files})
else()
add_library(${APP_NAME} SHARED ${all_code_files})
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
endif()
target_link_libraries(${APP_NAME} cocos2d)
target_include_directories(${APP_NAME}
PRIVATE Classes
PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/audio/include/
)
# mark app resources
setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")
endif()
elseif(WINDOWS)
cocos_copy_target_dll(${APP_NAME})
endif()
if(LINUX OR WINDOWS)
set(APP_RES_DIR "$<TARGET_FILE_DIR:${APP_NAME}>/Resources")
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()