DefVideoAds 3.4.2 "resource cannot be null"

#1

Hello!

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:

https://github.com/rgrams/rendercam/archive/v1.0.2.zip
https://github.com/subsoap/defsave/archive/v1.2.1.zip
https://github.com/defold/extension-gpgs/archive/1.2.3.zip
https://github.com/AGulev/DefVideoAds/archive/3.4.2.zip

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)

Thanks,
Mike

0 Likes

#2

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: https://github.com/defold/extension-gpgs/releases/tag/1.2.4

3 Likes

#3

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.

0 Likes

#4

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.

4 Likes