I strongly suggest creating a minimal repro project that you share for others to test/debug. It will shorten the turnaround times and guessing a lot.
I would love to! I have tried and failed:
I think it comes down to testing the remaining extensions one by one. This is very time consuming, as you might imagine, and I don’t have time to do this today (because I’m making a game, yay!).
I was hoping there was a less time consuming way to move forward. As it stands I have a functional .apk and .ipa with the Firebase extension removed, which works temporarily.
I’m just saying, as it stands right now, we have very little to go on, and I think we need more info to do any further investigation.
This is very time consuming
We know. That is the reason we recommend small repro cases, to minimize the overall cost for everyone involved.
Step one is to create an empty project, with the snippet of code from above and with all native extensions you use in your project:
Does it crash under those conditions? Does it happen on both iOS and Android?
I understand.
Access to your game project would be fine for me as well, if it possible from your side ofc.I would try to isolate issue myself if I be able to reproduce it.
Sorry for trying to take a shortcut! When I have a little more time I’ll make a minimal repro. Thanks for trying to figure this one out!
Yes, I agree.
I think I know what the problem (value_1 is null), but I don’t know why.
That’s why it would be nice to know Placements ID, because value_1 is PlacementId (or ErrorMessage). Null check will help with crash, but we will miss some info about error or placement.
Anyway, I’ll prepare fix today later.
Good evening DefVideoAds lovers! After a great deal of building and testing, the results are in. This is for Android only.
There is a crash when these extensions are all included:
- DefVideoAds
- Firebase
- IAP
- Google Play Game Services
A minimal example project: DefVideoAds Conflicts.zip (8.1 KB)
These combinations do not cause a crash:
- DefVideoAds + IAP + Google Play Game Services
- DefVideoAds + Firebase + Google Play Game Services
- DefVideoAds + IAP + Firebase
Hope this will make it easier to figure this out. If it helps I’ll do the same tests for iOS too.
Pls, take a look fixed version
The short version of explanation: developers should use namespaces in extensions.
A bit longer explanation:
in both gpgs extension and DefVideoADS we have the following line:
static dmArray m_callbacksQueue;
Both were written copied/pasted by me =)
There is problem with CallbackData because in both extensions both structures defined in global scope and in some cases DefVideoADS uses CallbackData (structure declaration) from gpgs.
We had similar issue with struct Command in a couple of our extensions a year ago.
I added namespace for DefVideoADS and now everything should be fine.
Sorry for inconvenience and thank you for help with catching this issue. Without repo-case it’s not so easy to do.
Fantastic! Great work by everyone involved!
I feel like I’ve run into similar bugs before, when I tried combining native extensions.
As someone who wants to write them someday, is namespacing something that should be added to the docs, and put into the sample native extension repos?
It should probably be added to the template project: GitHub - defold/template-native-extension: Template project for creation of Defold native extensions · GitHub
It’s either namespaces or making sure that all variables and functions are prefixed with the extension name: m_GpgpsCallbacksQueue and m_DefVideoAdsCallbacksQueue instead of just m_CallbacksQueue.
Honestly, is sounds like a big bug to me.
I cannot imagine this is a feature of C++, to merge two different symbols.
If anything, it should produce a “duplicate symbol” error.
Last time this happened (like @agulev mentioned), I wanted to look into it, but I forgot about it. But I’ll make some tests this weekend.
Also, good job creating the repro @totebo!
I have now tested DefVideoAds v3.4.9 on iOS and Android and can confirm it works with the whole onslaught of extensions listed above, including Firebase. Glorious happiness - and it’s Friday! ![]()
You’re most welcome!
Thanks!
Oh, sorry, I think I explained it wrong.
It’s not because of the same variable name m_callbacksQueue. It’s because of the same structure declaration CallbackData.
In DefVideoADS it is
struct CallbackData
{
int msg_type;
char* key_1;
char* value_1;
char* key_2;
int value_2;
};
But inGPGS:
struct CallbackData
{
MESSAGE_ID msg;
char* json;
};
In some conditions DefVideoAds uses CallbackData from GPSG and we got crash because in CallbackData from GPSG we don’t have value_1, key_1 and so on.
Ah, got it! I think @JCash is investigating this. We should get something like a “duplicate symbol” error or something while linking.
I’m just trying the extension example. If I try to use the “Sign IOS App” I get the following error:
If instead I bundle the project, the ipa is created and runs just fine.
Any clue?
Sorry, I don’t know what’s the problem here.
But you can use developer build of the app the same way you use “Sign ios app”
Seems like is not merging the manifests. Worth mentioning I’m on 1.2.174 beta.

