DefVideoAds 3.4.2 "resource cannot be null"



I’ve been working through my first full project with Defold, and really loving the productivity and performance.

Native extensions keep tripping me up, unfortunately. I’ve been trying to get an advertising extension to work alongside GPGS (which I’ve fully integrated and worked great). def_ironsource caused crashes on startup, and now DefVideoAds is failing to bundle for Android (“resource cannot be null”).

My full dependencies:

If I remove “extensions-gpgs”, the APK will build. Very confusing!

Using latest Defold 1.2.167 (engine SHA 96f7a5e4f617d5f6f4645f30a3e6ff656689435d).

Any ideas of what could be happening? Could this be related to the DefVideoAds extension including a pre-compiled JAR instead of using Gradle?

Build server log:
log.txt (22.1 KB)




Yes, the log shows that extension-gpgs and DefVideoAds (ping @AGulev) shares some utility functions with the same names. They are declared twice. I’ve fixed this in extension-gpgs (merged into main extension and made them static) and released a new version:



Thanks for the quick fix! Will give your update a try soon. I’d already copied the video ads extension locally and renamed those utilities to get around the error.

I’m looking forward to learning more about how the native extensions work, actually.

Is there a TL;DR version of why extensions can have conflicts like this? I’ve never done any C++ in my career, mostly C#, Java, and Javascript.



It is not really a mystery. Both extensions declared a function with the same name and didn’t scope the declaration to the extension itself. When the two extensions are built the linker detects that the symbol (function) is declared twice and throws an error. Basically the same problem as in any other programming language.