Linking SDKBOX IAP Plugin with v4 [Android]

Linking SDKBOX IAP Plugin with v4 [Android]
0

I just moved over to the new cocos2d-x v4 with metal backend and have installed the SDKBOX 2.5.0 IAP plugin via the GUI installer.

It’s my understanding that v4 has completely moved over to a cmake build system (no Android.mk anymore!), so I added the following into my CMakeLists.txt:-

add sdkbox lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
target_link_libraries(${APP_NAME} ext_sdkbox
)
endif()

add PluginIAP lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginIAP/)
target_link_libraries(${APP_NAME} ext_PluginIAP
)
endif()

as per the advice in this recent thread:- https://discuss.cocos2d-x.org/t/sdkbox-2-4-3-0-bugfix/44944/7

Everything compiles fine in Android Studio, including an #include to PluginIAP.h and a subclass of IAPListener, so PluginIAP is being recognised in some form. However, as soon as I add a call to IAP:init() I get a torrent of linker errors:-

…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_]+0xa0): undefined reference tosdkbox::JNIReferenceDeleter::operator()(_jstring*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_]+0xcc): undefined reference tosdkbox::JNIReferenceDeleter::~JNIReferenceDeleter()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEET_P8_jobjectPKcDpT0_]+0x140): undefined reference tosdkbox::Logger::LogImpl(sdkbox::LogLevel, char const*, char const*, …)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0x50): undefined reference tosdkbox::JNIUtils::GetJNIMethodInfo(_jobject*, char const*, char const*, _JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0x54): undefined reference tosdkbox::JNIUtils::__getEnvAttach()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0x64): undefined reference tosdkbox::JNIReferenceDeleter::JNIReferenceDeleter(_JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0x9c): undefined reference tosdkbox::JNIUtils::NewJString(char const*, _JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0xa8): undefined reference tosdkbox::JNIReferenceDeleter::operator()(_jstring*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0xd8): undefined reference tosdkbox::JNIReferenceDeleter::~JNIReferenceDeleter()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int>(_jobject*, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, int)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEET_P8_jobjectPKcDpT0_]+0x150): undefined reference tosdkbox::Logger::LogImpl(sdkbox::LogLevel, char const*, char const*, …)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x34): undefined reference tosdkbox::Proxy::Proxy()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x54): undefined reference tosdkbox::SdkboxCore::getInstance()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x88): undefined reference tosdkbox::SdkboxCore::getMetadata(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&) const’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x150): undefined reference tosdkbox::JNIUtils::__getEnv()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x1bc): undefined reference tosdkbox::Logger::e(char const*, char const*, …)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::IAPProxy()': (.text._ZN6sdkbox8IAPProxyC2Ev+0x1e0): undefined reference tosdkbox::Logger::i(char const*, char const*, …)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x58): undefined reference tosdkbox::JNIUtils::GetJNIMethodInfo(_jobject*, char const*, char const*, _JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x5c): undefined reference tosdkbox::JNIUtils::__getEnvAttach()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x6c): undefined reference tosdkbox::JNIReferenceDeleter::JNIReferenceDeleter(_JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0xc4): undefined reference tosdkbox::JNIUtils::NewMap(std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > > > >, _JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0xd0): undefined reference tosdkbox::JNIReferenceDeleter::operator()(_jobject*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x114): undefined reference tosdkbox::JNIUtils::NewJString(char const*, _JNIEnv*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x120): undefined reference tosdkbox::JNIReferenceDeleter::operator()(_jstring*)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x150): undefined reference tosdkbox::JNIReferenceDeleter::~JNIReferenceDeleter()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function void sdkbox::JNIInvoke<void, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(_jobject*, char const*, std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)': (.text._ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_[_ZN6sdkbox9JNIInvokeIvJNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEES8_EEET_P8_jobjectPKcDpT0_]+0x1f8): undefined reference tosdkbox::Logger::LogImpl(sdkbox::LogLevel, char const*, char const*, …)’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::init(std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const': (.text._ZNK6sdkbox8IAPProxy4initERKNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEERSC_+0x40): undefined reference tosdkbox::SdkboxCore::getInstance()’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::init(std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const': (.text._ZNK6sdkbox8IAPProxy4initERKNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEERSC_+0x48): undefined reference tosdkbox::SdkboxCore::getStoreConfig() const’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o): In function sdkbox::IAPProxy::init(std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const': (.text._ZNK6sdkbox8IAPProxy4initERKNSt6__ndk13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEERSC_+0x58): undefined reference tosdkbox::Json::dump() const’
…/…/…/…/jni/PluginIAP/libs_c++_static/arm64-v8a/libPluginIAP.a(IAPProxy.o):(.data.rel.ro._ZTIN6sdkbox8IAPProxyE[_ZTIN6sdkbox8IAPProxyE]+0x10): undefined reference to `typeinfo for sdkbox::Proxy’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Apologies for the extremely verbose error log, but I figured there might something in there that someone might spot of the root cause.

Anyone else seen this or know what’s going on?

missing ANDROID_STL

@yinjimmy I already have “-DANDROID_STL=c++_static” in my cmake arguments in build.gradle :thinking:

I also tried adding:-

set(ANDROID_STL “c++_static”)

to my CMakeLists.txt but I’m still getting the same linker errors. Has anyone successfully integrated SDKBOX with v4 on Android?

EDIT:

I switched the order of:-

add sdkbox lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
target_link_libraries(${APP_NAME} ext_sdkbox
)
endif()

add PluginIAP lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginIAP/)
target_link_libraries(${APP_NAME} ext_PluginIAP
)
endif()

to:-

add PluginIAP lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginIAP/)
target_link_libraries(${APP_NAME} ext_PluginIAP)
endif()

add sdkbox lib

if(ANDROID)
add_definitions(-DSDKBOX_ENABLED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
target_link_libraries(${APP_NAME} ext_sdkbox)
endif()

and the linker errors went away. Seems like you must specify the plugins before sdkbox in cmake.

1 Like

I’ll write the NOTE into the doc.

and why you want to try v4?

Good to have all the latest fixes and I assume Metal renderer will be required on iOS at some point.

updated the doc http://docs.sdkbox.com/en/qa/sdkbox-cmake/#note-plz-keep-pluginxxx-before-sdkbox

thanks,

OpenGL is deprecated, but not removed yet. You will need to switch at some point, but not right away. Stick with stability for now, v3.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.