solar2d.builder - how does it work?

Hi all! I’m completely new to Solar2D (as in, I literally just started messing with it today).

It looks really awesome all in all, but there’s one thing that pushed me into a rabbit hole. Apparently, the default way to build is through the Simulator UI and it seems that every single time I try to build an apk/aab I need to type in all the data again, e.g. app name and android package, etc.

Now, I managed to find out about the console build tool, which seems to be called solar2d.builder in my version, which should let me script it.

The trick is that I just can’t figure out how exactly to use it. When I tried to imitate the examples I found on this forum and elsewhere on the web where they load a lua file, I’d get a cannot open build/android.lua: Permission denied - maybe a linux issue, as I’m running on it.

And when I tried to load the data through stdin, the format defaulted to json. Which s also good, except that when I converted the lua file to json and tried again… then it complained about “malformed or invalid build arguments” but without specifying which arguments are missing.

It feels like I’m missing something obvious. If this rings a bell for anyone here I’d be very grateful if you could give me a hint.

This is how my (now json) file looks like:

    "platform": "android",
    "appName": "My Cool App",
    "appVersion": "2.0.0",
    "androidAppPackage": "",
    "versionCode": 2,
    "versionName": "2.0.0",
    "dstPath": "./target",
    "projectPath": ".",
    "sdkPath": "/home/username/Android/Sdk"

I don’t know why you say that you need to rewrite the data to create your build. The simulator save the data you entered the first time that you created a build.

It doesn’t. Every time I open the build popup, I see the default data. This could be a bug in my version/build.

Well, I don’t really know. Did you installed the last Solar2D build available?

I’m not really sure if this is a Linux specific issue but the Permission denied error and build data not saving issues might need more investigation. Can you confirm that this isn’t a permission/file access issue? I’m not sure about the command line tool but as @aclementerodrguez pointed out, build UI should be saving your latest successful build options.

I can confirm, Snap version of Solar2D for Linux doesn’t save Android project variables.

As for Solar2DBuilder, I can run it while pointing to the android.lua file without issues; the returned data must be a Lua table, not JSON.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.