Editor2 - possible issue with libraries and extensions?

I’ve been using Editor2 for this project and it seems to work well, for the most part. However I’ve run into two strange behaviors that may be indicative of a larger issue.

I was trying to use britzl’s native-timer extension. I followed instructions and added it to my project as a dependency, linking to the github repo. I saw it add the plugin to my project, but when I ran my project, I got the following:

attempt to index global ‘timer’ (a nil value)

I tried a few things but ended up going back to a lua module for it and shrugged it off as “I’m not doing it right.” But then Appodeal released their library, and I tried implementing it. I followed the instructions, but got the same error as the timer:

attempt to index global ‘appodeal’ (a nil value)

I’m still thinking I’m doing it wrong, but to have the same issue with two separate externals raises a flag for me, and I thought I’d mention it.

Any insights would be welcome.

The timer extension is available on all platforms so it’s quite surprising that it doesn’t work. Which OS are you working on? Where have you installed Defold? What happens if you copy the timer extension folder into your game instead of adding it as a dependency?

I’m developing on Linux, targeting Android at the moment. I have Defold installed to a directory on my secondary drive that is not in my path. I’m running it by double-clicking the execuatable file.

I have not tried copying the timer extension into my game directory instead of adding it as a dependency, but I can try it. However, I copied the appodeal folder into my game directory and got the same error. I’m taking a lunch here in about 20 mins and will have a little more time to futz with it

What if you open preferences and change the build server URL to foobar.com? If the editor correctly picks up that there’s a native extension you should get an error when building.

Interesting. I get no error.

Do you see the ext.manifest file? What if you copy the timer extension into you project and build? What if you add some junk to ext.manifest and build?

I’m starting to suspect that native extension aren’t detected on Linux…

I have to head back to the office, so I’ll try that later.

One other piece of info: if I don’t have my phone connected and dmengine running, I get the error “Native extensions not supported on this platform.”

Oh, crap. Yes, I tested this earlier today. Not sure how I could overlook that in my communication with you. Really sorry about that.

Bundling/building projects with native extensions for Linux doesn’t work in Editor 2. Editor 1 works though. You should be able to bundle to other platforms though.

No problem, at least you found the issue!

But could you please confirm that it works if you bundle to another platform (iOS or Android perhaps)?

A fix for that was released yesterday. Please try again! :slight_smile:

3 Likes

Super, let me try again, but what’s the url for the build server? I changed it but didn’t change it back and have since lost the original value.

The default value is "https://build.defold.com"
I added a feature request for resetting settings to default values.

2 Likes