Cocos2dx 3.17 SDKBox Share Plugin Android Release build error

Hi there, I’m having real problems with SDKBox on 3.17 trying to get the app building for release. From a clean project, I’ve installed IAP and Review and have managed to get it building for release (despite coming across problems with Review).

However, when I install Share, I’m getting the following build error… (Note: I’ve also tried installing from fresh from the staging server. 2.4.0.2)

[armeabi-v7a] SharedLibrary : libcocos2djs.so
/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/jni/./pluginshare/libs_c++_static/armeabi-v7a/libPluginShare.a(ShareBaseConnectorProxy.o):function std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >::~basic_stringstream(): warning: relocation refers to discarded section
/Users/Dev/Library/Cocos/CocosStore/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin/ld: error: treating warnings as errors
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so] Error 1
:test:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:test:externalNativeBuildRelease’.

Build command failed.
Error while executing process /Users/Dev/Library/Cocos/CocosStore/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/jni/Android.mk NDK_APPLICATION_MK=/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/jni/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/lib NDK_TOOLCHAIN_VERSION=clang -j4 NDK_DEBUG=0 /Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so}
[armeabi-v7a] SharedLibrary : libcocos2djs.so
/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/jni/./pluginshare/libs_c++_static/armeabi-v7a/libPluginShare.a(ShareBaseConnectorProxy.o):function std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >::~basic_stringstream(): warning: relocation refers to discarded section
/Users/Dev/Library/Cocos/CocosStore/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin/ld: error: treating warnings as errors
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so] Error 1

Any ideas?

plz checkout https://pan.baidu.com/s/1XFa8SpLrVytLcp8-rvjS9A

our staging server has been broken. i’m fixing it.
Thanks,

Many thanks, but I copied over all of the necessary files but now I’m getting this error…

/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/jni/./pluginshare/libs_c++_static/armeabi-v7a/libPluginShare.a(ShareConnectorUtils.o):function std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >::~basic_stringstream(): warning: relocation refers to discarded section
/Users/Dev/Documents/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin/ld: error: treating warnings as errors
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/Dev/Documents/CocosProjects/test/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so] Error 1

I got you, will fix tomorrow.

Great, thank you. Please let me know when it’s up and running.

plz help to check bellow static library.

pluginshare.zip (516.3 KB)

Thank you for that. It does seem to do the trick however it requires disabling of minify and shrink resources in able to build. Not a big problem for me but I’m sure it might affect others.

what about IAP? We have same problem: /Users/andrew/work/sources/cocos2d/woh/proj.android/app/jni/./PluginIAP/libs_c++_static/armeabi-v7a/libPluginIAP.a(IAPWrapper.o):function std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::~basic_ostringstream(): warning: relocation refers to discarded section with cocos 3.17 and SDKBox IAP

had the same issue, was caused by proguard
Gradle -> build types:

        minifyEnabled false
        shrinkResources false

or configure ur proguard for it.

1 Like

doesn’t help on clang toolchain.

Try downlading from the staging server (sdkbox import iap --staging). I think they have fixed it on there.

yes, we checked most all std::stringstream code.
And have a release today.

1 Like

nothing changes with staging iap (v2.4.0.2)

plz try staging again, v2.4.0.3

with v2.4.0.3 build succeed, thanks

I can’t even download it, all download links are broken.

plz try again and again.