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.
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.
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…
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.