Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

2.4Kb jar is rejected from server because it is 1.8Mb with dependencies

24 views
Skip to first unread message

P5music

unread,
Jun 17, 2021, 3:19:21 AM6/17/21
to CodenameOne Discussions

I have a free account and sometimes I need to build my app on Android with the server build. (I am trying to build with AndroidStudio but there are some issues)
Until now it was possible.

When I switched to maven, and possibly also because I replaced Flamingo classes with real images, the jar limit seems to have been reached.

I find a message about this in the build output (that is successful) on IntelliJ IDEA IDE.

It is strange because my app did not change so much.
It has a 2.4Kb footprint when considered alone, if I am not wrong.

I knew that dependencies do not pile up.
What's going on?
Regards

Shai Almog

unread,
Jun 17, 2021, 11:31:58 PM6/17/21
to CodenameOne Discussions
The dependencies are part of the jar. We don't package them in the servers. I suggest checking which dependency blew up the jar and removing that dependency.

P5music

unread,
Jun 18, 2021, 2:09:31 AM6/18/21
to CodenameOne Discussions
It seems that the app just has the JSON library dependency.
Regards

Shai Almog

unread,
Jun 18, 2021, 11:22:31 PM6/18/21
to CodenameOne Discussions
I guess that's a big dependency. Which library did you use?
Try to build with dependencies in maven and unzip the resulting jar to see what gets packaged there.

P5music

unread,
Jun 21, 2021, 6:29:33 AM6/21/21
to CodenameOne Discussions
I inspected the jar and I realized that it is not JSON's fault.
There are three reasons the footprint grow:
1-I loaded images inside the theme.res (964kb) 
I loaded 512px images and CN1 created the derived ones I guess, but are they created before installing? Should not they be created in the app folder at installation time?
2-I found a file that is not found in the project, I do not see it: white_container_theme.res (594kb). It was created some time ago but I think it is not used anywhere. In fact it is neither seen in the project structure nor inside the theme.res itself, still it is in the jar (?) I also searched the occurrence in the project but it is not found.
3-The html folder is duplicated (170Kb)

I do not know if the limit would not be exceeded but each point is worth understanding.

Thanks
Regards

Shai Almog

unread,
Jun 21, 2021, 10:26:15 PM6/21/21
to CodenameOne Discussions
Odd, I'll need to check. Make sure to define the DPI of your image to dpi 0.
Reply all
Reply to author
Forward
0 new messages