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: https://github.com/defold/template-native-extension
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.
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.