Overcoming AI max app size

6,534 views
Skip to first unread message

M. Hossein Amerkashi

unread,
Mar 11, 2012, 2:43:44 PM3/11/12
to appto...@googlegroups.com
I believe max app size for AI apps are 5.5MB. There has  been questions on how to overcome this limit and here is a scenario and approach to overcome this limit.

Let's say that you have an app that includes many media files and images. Once user clicks on a button, then you set the source of sound to a sound file and the play the sound. Another scenario is that you have many buttons and a common button; e.g. btnAnimals with an assigned image. Once user clicks on a different button, you want to change the image of the btnAnimals. The size of the app could go quite high with sound and images and this could throw you over the AI app size. Here is one approach to overcome this:

DO NOT load all your media files into AI.
Try out your logic for couple of buttons.
Once done, in AI, download the .apk to your computer
Using AppToMarket, tab2, button 1, decompile your .apk
This will create a subfolder called temp_myDecompiles\assets
Goto above subfolder and drop all your media files - You can also overwrite the images with higher quality images
Then in AppToMarket, use button3 to re-package your app and prepare it for publishing to Android Market (now called Google Play)

You are done.

-Hossein



----------------------
On Sun, Mar 11, 2012 at 1:06 PM, Tom & Cindy Bright <ctmoo...@gmail.com> wrote:
You posted a brief message indicating how to get around the app size limit and allow for access to large numbers of images. Can you elaborate on that, or point to more detailed instructions in the documentation??
 
TOM
 

zabara katranemia

unread,
Apr 22, 2012, 4:38:53 AM4/22/12
to appto...@googlegroups.com
This subfolder is never created with version 2.5. Can you be more specific?

M. Hossein Amerkashi

unread,
Apr 25, 2012, 9:50:42 AM4/25/12
to appto...@googlegroups.com
Did you try to decompile using AppToMarket (tab 2)?

-Hossein.

Robert Davis

unread,
Sep 12, 2012, 10:50:53 PM9/12/12
to appto...@googlegroups.com
Hi, I used the method below and I can see my media on the emulator however when i connect to a phone (as an emulator) or download to a phone i can't see the media. can someone help


On Sunday, March 11, 2012 11:43:44 AM UTC-7, M. Hossein Amerkashi wrote:
I believe max app size for AI apps are 5.5MB. There has  been questions on how to overcome this limit and here is a scenario and approach to overcome this limmit.

M. Hossein Amerkashi

unread,
Sep 12, 2012, 11:11:50 PM9/12/12
to appto...@googlegroups.com
Robert,
So, you added more images using this approach? Did you make sure that the new files that you are adding has the correct as the ones that are originally used in the AI?

-Hossein

Robert Davis

unread,
Sep 18, 2012, 11:07:05 PM9/18/12
to appto...@googlegroups.com
Hi, I used the method below and I can see my media on the emulator however when i connect to a phone (as an emulator) or download to a phone i can't see the media, they are only pictures. Can someone help please? This is the only thing at this time keeping me from putting my app on the market. 



On Sunday, March 11, 2012 11:43:44 AM UTC-7, M. Hossein Amerkashi wrote:

Robert Davis

unread,
Sep 18, 2012, 11:08:33 PM9/18/12
to appto...@googlegroups.com
yes they are the exact same. i don't see any pictures

Robert Davis

unread,
Sep 18, 2012, 11:09:26 PM9/18/12
to appto...@googlegroups.com
i am just at the point where i want to test the app on a phone before i put it on the market

Robert Davis

unread,
Sep 18, 2012, 11:10:30 PM9/18/12
to appto...@googlegroups.com
i packaged from AI to a phone and the pictures don't show

Dinakar Subramanian

unread,
Jan 26, 2013, 1:20:05 PM1/26/13
to appto...@googlegroups.com
Hossein:

thanks for the information.  I am going to try this for a similar issue.  On the apptomarket page, I see both the apptomarketxx.zip file and the sdkBridger zipfile.  do I need both?

Thanks a lot
Dinakar

Leonardo Oliveira

unread,
Jan 31, 2013, 6:20:57 PM1/31/13
to appto...@googlegroups.com

And found it easier method that was first. That speaks to not load all medias AppInventor.
But do this in ApptoMarket. however do not understand how it's done. 
Could you explain better,  how do I load the media in apptomarket?

M. Hossein Amerkashi

unread,
Jan 31, 2013, 6:58:53 PM1/31/13
to appto...@googlegroups.com
You don't really load them into AppToMarket. You just use AppToMarket to decompile the .apk.
Once decompiled, check the subfolder called temp_myDecompiles.
In above subfolder, check the assets subfolder. That's where all your media files are.
Now add / replace media files and then repackage.

-Hossein.

Charlie Fletcher

unread,
Jun 25, 2013, 12:50:47 PM6/25/13
to appto...@googlegroups.com
Hi Hossein. I know it's a whil since you posted this however i've just tried it and although i magaed to update the manifest and repackage, when I try and install to my phone (via the easy installer) it fails? Am I missing something?

many thanks

Charlie

M. Hossein Amerkashi

unread,
Jun 25, 2013, 2:02:18 PM6/25/13
to Charlie Fletcher, AppToMarket
Did you uninstall the original AI from your phone?

Also, Did you know there is a standalone AI version that overcomes the 5mb apk limit? Check it out HERE.

-Hossein.


--
For Java Bridge (sdkBridger), visit http://code.google.com/p/apptomarket/
---
You received this message because you are subscribed to the Google Groups "AppToMarket" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apptomarket...@googlegroups.com.
Visit this group at http://groups.google.com/group/apptomarket.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Monita Rossy

unread,
Aug 23, 2013, 12:05:48 PM8/23/13
to appto...@googlegroups.com
hey Anyone know about this problem resolution
trouble.jpg

Paolo C.

unread,
Sep 11, 2013, 4:52:18 PM9/11/13
to appto...@googlegroups.com, Charlie Fletcher
Hi Hossein,
 I'm very frustrated because I didn't understand how to overcome 5MB limit because when I try to pack to .apk, AILiveComplete! give me the same error like AI online version: it's impossible to package over 5 MB!!!
 
Please let me know possible step by step how it's possible to solve this issue with your offline AI
 
Many thanks!
Paolo

M. Hossein Amerkashi

unread,
Sep 12, 2013, 8:51:49 AM9/12/13
to Paolo C., AppToMarket, Charlie Fletcher
I'll check it out this weekend to see what's going on.

-Hossein.

M. Hossein Amerkashi

unread,
Sep 14, 2013, 1:15:32 AM9/14/13
to Paolo C., AppToMarket, Charlie Fletcher
Okay, Here is the procedure to build apk that are > 5mb. Give below a shot and let us know how it goes.

[1] is a command that needs to be run from a DOS window. 
Update it to point to your source AI file and output destination folder
You have to open a DOS window and cd to folder:    ailivecomplete\buildserver\lib
and copy/paste the updated script (with your data) to window and run


Its late and I didn't put that into script. If anyone likes, PLEASE write up a dos batch file to automate so that it could take in:
input source file,
user name
output folder

 

[1]
"%JAVA_HOME%\bin\java" -Xmx1g -cp BuildServer.jar;CommonUtils.jar;CommonVersion.jar;FastInfoset-1.2.2.jar;activation-1.1.jar;args4j-2.0.18.jar;asm-3.1.jar;commons-io-2.0.1.jar;grizzly-servlet-webserver-1.9.18-i.jar;guava-14.0.1.jar;http-20070405.jar;jackson-core-asl-1.9.4.jar;jaxb-api-2.1.jar;jaxb-impl-2.1.10.jar;jaxb-xjc.jar;jdom-1.0.jar;jersey-bundle-1.3.jar;jersey-multipart-1.3.jar;jettison-1.1.jar;json.jar;jsr311-api-1.1.1.jar;localizer.jar;mail-1.4.jar;rome-0.9.jar;sdklib.jar;stax-api-1.0-2.jar;wadl-cmdline.jar;wadl-core.jar;wadl2java.jar -Dfile.encoding=UTF-8 com.google.appinventor.buildserver.Main  --inputZipFile C:\Users\Me\Downloads\SQLite3.zip --userName kkas...@gmail.com --outputDir C:\Users\Me\Downloads





M. Hossein Amerkashi

unread,
Sep 18, 2013, 11:21:19 PM9/18/13
to appto...@googlegroups.com, Paolo C., Charlie Fletcher
Paolo C.,

Did you re-try with the given setup instruction to build files > 5mb?


-Hossein.

tasos adda

unread,
Sep 20, 2013, 10:48:00 AM9/20/13
to appto...@googlegroups.com
Mr Hossein hallo again...

As i told you before i had a big problem packaging my apk.
As you see in the attachment the process stoped at 75% and then the error "your build failed duo to an error in the DX stage, not because of an error in your program"

I had followed all of your instruction how to install AiLive Complete and opened first WinStartAiServer and then WinStartBuildServer. Then i upload my zip file and keystore from AppInventorBeta and tried to download the complete apk to my computer. Then as you see at the attachment the process failed at 75%

After i tried to do the same thing but i opened WinStartBuildServerWithHeap instead the other cmd file. And suddenly with no problems my apk downloaded at my computer.
Which is the difference working in WinStartBuidServerWithHeap instead WinStartBuildServer ? 
Is everything ok with my apk with this method? (WinStartBuildServerWithHeap) 

I want to thank you very much for all of your help and my best regards for all of your work here!!!  


dx error.JPG

M. Hossein Amerkashi

unread,
Sep 20, 2013, 11:19:23 AM9/20/13
to tasos adda, AppToMarket
Great that it worked out.

Yes, you can keep using WinStartBuildServerWithHeap.cmd for your build server.
Basically, the WinStartBuildServerWithHeap.cmd batch file, increases the memory that jvm uses.

-Hossein.


tasos adda

unread,
Sep 20, 2013, 11:22:20 AM9/20/13
to appto...@googlegroups.com, tasos adda


Thank you very much again  for your help!!!! 
My best regards Tasos 

Charlie Fletcher

unread,
Sep 28, 2013, 10:07:23 AM9/28/13
to appto...@googlegroups.com, Paolo C., Charlie Fletcher
Hi Hossein. regarding the procedure to build apk > 5mb.

Is this script to be run INSTEAD of the 'Download to this Computer' option. If so I'm a bit confused about the input file. Is this the name of the project that I want to package?

I tried running it from the ailivecompletev1.34\builderver\lib directory and got the following error:


C:\Users\Charlie\AiLiveCompleteV1.34\BuildServer\lib>"%JAVA_HOME%\bin\java" -Xmx

1g -cp BuildServer.jar;CommonUtils.jar;CommonVersion.jar;FastInfoset-1.2.2.jar;a
ctivation-1.1.jar;args4j-2.0.18.jar;asm-3.1.jar;commons-io-2.0.1.jar;grizzly-ser
vlet-webserver-1.9.18-i.jar;guava-14.0.1.jar;http-20070405.jar;jackson-core-asl-
1.9.4.jar;jaxb-api-2.1.jar;jaxb-impl-2.1.10.jar;jaxb-xjc.jar;jdom-1.0.jar;jersey
-bundle-1.3.jar;jersey-multipart-1.3.jar;jettison-1.1.jar;json.jar;jsr311-api-1.
1.1.jar;localizer.jar;mail-1.4.jar;rome-0.9.jar;sdklib.jar;stax-api-1.0-2.jar;wa
dl-cmdline.jar;wadl-core.jar;wadl2java.jar -Dfile.encoding=UTF-8 com.google.appi
nventor.buildserver.Main  --inputZipFile C:\Users\Charlie\Downloads\Largetest.zi
p --userName te...@example.com--outputDir C:\Users\Charlie\Downloads
No argument is allowed: C:\Users\Charlie\Downloads
 --childProcessRamMb N            : Maximum ram that can be used by a child
                                    processes, in MB.
 --inputZipFile FILE              : the ZIP file of the project to build
 --isForStemCellApp (--isForRepl) : create APK suitable for Phone App
 --isForWirelessRepl              : create the AppInventorDebugger APK
 --outputDir FILE                 : the directory in which to put the output of
                                    the build
 --userName VAL                   : the name of the user building the project

I'm definitely missing something and would be grateful of your advice?

Many thanks

Charlie

M. Hossein Amerkashi

unread,
Sep 28, 2013, 12:09:38 PM9/28/13
to Charlie Fletcher, AppToMarket, Paolo C.
What you are doing is correct. However, it seems you are missing a space in the command file. See below. Right after 'example.com' you need to add a space

-userName te...@example.com--outputDir C:\Users

-Hossein

Charlie Fletcher

unread,
Sep 28, 2013, 12:48:35 PM9/28/13
to M. Hossein Amerkashi, AppToMarket, Paolo C.

Hi Hossein, added the space and I now get the following error:

 

Sep 28, 2013 5:45:08 PM com.google.appinventor.buildserver.Main main

SEVERE: Problem opening inout zip file: LargeTest.zip

 

Thanks

 

Charlie

M. Hossein Amerkashi

unread,
Sep 28, 2013, 1:02:52 PM9/28/13
to Charlie Fletcher, AppToMarket, Paolo C.
That means your path to your source (.zip) file is not correct. Make sure you are pointing to correct full path.


-Hossein

Adam Cottrell

unread,
Dec 19, 2013, 10:40:51 PM12/19/13
to appto...@googlegroups.com, Paolo C., Charlie Fletcher
So I opened Command Prompt and put in the code with my own input .zip and output folder and it says

 'C:\Program' is not recognized as an internal or external command, operable program or batch file. 

How do I fix this?

Ahmad Saadeh

unread,
Aug 10, 2014, 12:25:49 AM8/10/14
to appto...@googlegroups.com, kkas...@gmail.com, cocc...@gmail.com, cflet...@googlemail.com
HELP
HELP HELP PLEASE HELP!!!
Hello Hossein!! My name is Ahmad.  I followed every direction.  But after i repackage, the media files that i added to my assets folder get deleted everytime... Please help i need those files to have my app work corectly.  please help me!!  asaad...@gmail.com  or  908*884*5514 cell phone or  kik: adotplo

Chaitali Kulkarni

unread,
Sep 27, 2017, 12:45:31 PM9/27/17
to AppToMarket
Hi

So I did exactly what you said and when I try to install the app on my phone using the .apk, it says app not installed. So to debug the error, I decompiled the app and recompiled it using AppToMarket and made no changes. But it still doesn't install. On the other hand, the original .apk that I downloaded from the MIT AI website installs properly. 

What should I look at to debug this?

Thanks you!
Reply all
Reply to author
Forward
0 new messages