# solar2d.builder - how does it work?

**URL:** <https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120>\
**Category:** Games\
**Created:** [November 13, 2023, 4:14pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120 "2023-11-13T16:14:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![funkybunny](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/b9bd4f/32.png) [@funkybunny](https://forums.solar2d.com/u/funkybunny)\
**Post date:** [November 13, 2023, 4:14pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/1 "2023-11-13T16:14:01Z")

</div>

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:

```auto
{
    "platform": "android",
    "appName": "My Cool App",
    "appVersion": "2.0.0",
    "androidAppPackage": "my.package.name",
    "versionCode": 2,
    "versionName": "2.0.0",
    "dstPath": "./target",
    "projectPath": ".",
    "sdkPath": "/home/username/Android/Sdk"
}

```

---

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [November 13, 2023, 4:59pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/2 "2023-11-13T16:59:23Z")

</div>

> [@funkybunny](#):
>
> 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:

Hi,  
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.

---

<div class="post-metadata">

**Author:** ![funkybunny](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/b9bd4f/32.png) [@funkybunny](https://forums.solar2d.com/u/funkybunny)\
**Post date:** [November 13, 2023, 5:22pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/3 "2023-11-13T17:22:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [November 13, 2023, 5:32pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/4 "2023-11-13T17:32:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bgmadclown](https://forums.solar2d.com/user_avatar/forums.solar2d.com/bgmadclown/32/490_2.png) [@bgmadclown](https://forums.solar2d.com/u/bgmadclown)\
**Post date:** [November 14, 2023, 10:28pm UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/5 "2023-11-14T22:28:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Siu](https://forums.solar2d.com/user_avatar/forums.solar2d.com/siu/32/2129_2.png) [@Siu](https://forums.solar2d.com/u/Siu)\
**Post date:** [November 15, 2023, 7:42am UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/6 "2023-11-15T07:42:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://forums.solar2d.com/uploads/default/original/1X/1bf6a947166df24e92aaa3358558f4b82d7f3d5a.png) [@system](https://forums.solar2d.com/u/system)\
**Post date:** [May 13, 2024, 7:42am UTC](https://forums.solar2d.com/t/solar2d-builder-how-does-it-work/356120/7 "2024-05-13T07:42:44Z")

</div>

Closed on May 13, 2024, 7:42am UTC

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