Conflict of 2 extensions GameAnalytics and Defold-luasec (SOLVED)

Haha. Sorry I must been tired when I tested if the openssl extension worked with luasec extension but when I test now it works fine. I think I must have forgotten to restart the editor before testing :slight_smile:

I am still missing to add native libraries for Android and iOS to the openssl extension because GameAnalytics SDK extension only uses the openssl libs for windows, linux and mac platforms.

3 Likes

I have added Android and iOS platform libs to the openssl extension now. It works fine building for iOS with luasec extension but I get this error when building for Android:

1 Like

We don’t have warnings as errors and non of those warnings are really fatal.
If you are using the BETA version, you’ll now get the full log.txt in the build folder, it should help to narrow the issue down.

2 Likes

If I use the beta version (1.2.165) then I just get this error when building for android with both the original version of luasec and a modified version which I try to get to work with the openssl extension:

The original version of luasec compiles fine on 1.2.164. Not sure what it means. No full log.txt in build folder either.

Are you also using the beta server?

https://build-stage.defold.com

Ah sorry no. Haven’t used the beta version before. Will try that.

Ok I got back to original error again but I don’t see the log.txt file (no build is generated because of the error). Where should the log.txt be located? In the folder you choose for the build to be created in or where?

Search for log.txt in your build folder in your project

Sorry I still can’t find it within the “build” folder in my project. Do I need to enable anything to produce it?

AH, the log currently only ends up there in case of a successful build.
I need to fix that issue too, so that it’s always stored on disc. Sorry for sending you on a wild goose hunt! HONK

I’ll try to find the log on the server instead…

EDIT: And here it is:

armv7a-linux-androideabi16-clang++ -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -static-libstdc++ build/main_tmp3.o  -o build/libdmengine.so -Wl,-soname=libdmengine.so -DDLIB_LOG_DOMAIN="ENGINE_MAIN" -DDM_PLATFORM_ANDROID -DLUA_BYTECODE_ENABLE_32 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__   -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text -L/tmp/job7606122260308143161/build -L/tmp/job7606122260308143161/upload/openssl/lib/armv7-android  -L/var/extender/sdk/a404b463128a6eecf3d5cce4916180b222488123/defoldsdk//lib/armv7-android -L/var/extender/sdk/a404b463128a6eecf3d5cce4916180b222488123/defoldsdk//ext/lib/armv7-android -L/opt/platformsdk/android/android-ndk-r20/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a  -Wl,-Bstatic -Wl,--start-group -lc++_static -lengine_release -lengine_service_null -lprofilerext_null -lengine_release -lengine_service_null -lprofilerext_null -lengine_release -lengine_service_null -lprofilerext_null  -l2 -l1 -lcrypto -lssl  -lmbedtls -lwebviewext -lfacebookext -liapext -lpushext -liacext -lrecord_null -lgameobject -lddf -lresource -lgamesys -lgraphics -lphysics -lBulletDynamics -lBulletCollision -lLinearMath -lBox2D -lrender -lscript -lluajit-5.1 -lextension -lhid -linput -lparticle -lrig -ldlib -ldmglfw -lgui -lcrashext -lsound -lopenal_soft -ltremolo -lliveupdate -lunwind -lcares  -Wl,--end-group -Wl,-Bdynamic  -lEGL -lGLESv1_CM -lGLESv2 -lOpenSLES -lm -llog -lc  -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(cryptlib.o):cryptlib.c:function OPENSSL_showfatal: error: undefined reference to 'stderr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(eng_openssl.o):eng_openssl.c:function openssl_load_privkey: error: undefined reference to 'stderr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(eng_openssl.o):eng_openssl.c:function test_rc4_init_key: error: undefined reference to 'stderr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'tcgetattr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'stdin'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'stderr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function close_console: error: undefined reference to 'stdin'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'signal'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
/tmp/job7606122260308143161/upload/openssl/lib/armv7-android/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Not sure why it’d complain on that though.
Perhaps NO_STDIO should be used when compiling OpenSSL?

2 Likes

Thanks for the log @Mathias_Westerdahl. After adding a few extra flags when building the openssl libs for android it works now together with luasec. The openssl extension have of course been updated with the new libs for android as well.

3 Likes

Very nice!
Good job!

We’ll see in the future, if we can also make it possible for you to use the new lib we use MbedTLS, to even further slim down the exe size. But that’s for the future :slight_smile:

3 Likes

after some time I decided to try to implement GameAnalytics again, but still same issue :hushed:

my dependencies:

dependencies = 
https://github.com/britzl/defold-luasocket/archive/master.zip,
https://github.com/britzl/defold-luasec/archive/master.zip,
https://github.com/britzl/defold-websocket/archive/master.zip,
https://github.com/defold/extension-facebook/archive/2.4.0.zip,
https://github.com/colyseus/colyseus-defold/archive/0.12.x.zip,
https://github.com/AGulev/set_screen_position/archive/master.zip
https://github.com/AGulev/jstodef/archive/master.zip,
https://github.com/GameAnalytics/GA-SDK-DEFOLD/archive/master.zip,
https://github.com/GameAnalytics/defold-openssl/archive/master.zip

@mts need I use specific version of sdk?

I think the luasec extension needs to add the defold-openssl extension to its dependencies for it to work or else they will both extensions try to add the openssl libraries. I think I got it to work that way. Correct me if I am wrong.

@BunBunBun the OpenSSL libraries were moved to a seperate extension since v3.1.0

I tested with too, it’s in a list in my message above :slight_smile:

https://github.com/GameAnalytics/defold-openssl/archive/master.zip 

The problem is that the luasec extension still has the libs inside the extension and is not using the openssl extension instead: https://github.com/britzl/defold-luasec/tree/master/luasec/lib. The openssl extension though only has libs for windows, mac and linux. So if you quickly want to fix the problem without waiting you need to download the luasec extension and manually add it to your project but delete the libs for windows, mac and linux (or just the platforms you will be using) and then add the openssl extension dependency to the or else you need to wait for a fix by the author of the extension I guess @BunBunBun

2 Likes

I will check this, thanks!

1 Like

Oh, should I update the extension? (I haven’t followed the recent discussion here, sorry)

3 Likes

Yes @britzl. To avoid having duplicate symbols (from openssl libs) from both GA and luasec extension the openssl should be moved to a separate extension which they should then both dependent on. I have created one here https://github.com/GameAnalytics/defold-openssl but it doesn’t have all the libs for the platforms that luasec extension openssl libs (as GA extension only uses openssl libs from Windows, Mac and Linux) so I don’t know if you want to fork the repo and add the missing libs or something like that and then we use that extension instead. What do you think?

3 Likes