error when compiling .apk file

309 views
Skip to first unread message
Assigned to halatmi...@gmail.com by steve....@gmail.com

toe....@talk21.com

unread,
May 22, 2014, 9:02:20 AM5/22/14
to mitappinv...@googlegroups.com

Hi just edited my app so it should auto resize for any screen
first screen was ok, today i finished of resize for screen 2
all works fine when i try over wifi to phone
but when i try compiling the .apk file i get an error




SteveJG

unread,
May 22, 2014, 9:16:33 AM5/22/14
to mitappinv...@googlegroups.com
Check your code for coding errors (from Blocks screen lower left, )does the red triangle have a number greater than 0 associated with it?  If so, find the block with the triangle in red...it has errors.
Is your app over 5 Mb?   This could prevent a compile.  The file + app size limit is 5Mb).

Did you upgrade to aiCompanion 2.18?  If not, this could be an issue.

or

Loading and saving projects

App Inventor says there's an error and it cannot load my project.

This might be a transient error coming from App Inventor's link to the cloud storage system. Try again after waiting a minute and see if the problem recurs. If the problem does recur, then there is probably some problem with the project file itself. Please file an issue report telling us about it. Attach the project source (aia file) if you can.


or 


Building projects

When I try to build my project, it fails with "unexpected problem generating Yail".

This error occurs if building the project fails at the very last stage. This error message is a catch-all that covers "unexpected" errors where App Inventor hasn't provided a useful error message.

There are several situations where this error has been observed. One is with large projects that have multiple screens: The individual screens build correctly, but the system runs out of space in putting all the screens together at the final packaging. Another situation is where the project file is corrupted, for example by the user unzipping it making an edit and then re-zipping it. This can lead to spurious files being included in the new zip file, which confuse the compiler. Another might be bad names for figures or other assets, that can trip up the compiler.

If your project gets this error, think about whether there could be causes like the two listed above. If that doesn't help, try asking in the Forum: You'll need to attach your project source so that someone can try to diagnose the problem.

When I try to build my project it fails with "Server error: could not build project".

This could be the result of a transient storage failure, so try again. If the problem persists, this is a similar issue as for "unexpected problems generating Yail. One program issue that causes a build failure is if your program contains two event handlers for the same event with the same component (for example, two Button1 when-clicked definitions). This is a known bug in App Inventor that will be fixed. Until then, if your program build fails, check to see if you've defined multiple event handlers for the same event.

When I try to install my project on the phone, I get the error "unable to parse package".

One possible cause for this error is that your phone does not have enough free memory to install your app. Also, when an app is installed it is expanded from the APK file: the installation requires about 3 times as much space as the size of the APK.
Look under your phone's settings to see how much available storage you have. You might need to uninstall some older apps to create the necessary space. Android installs Appi Inventor apps in its internal memory, so even if you have space on the external memory (SD card) you might still have problems. The "unable to parse" error can also occur when the APK file is too large or includes extraneous files. Check the files listed under Media to see if any were included by mistake, or if there are any that you don't need.

may apply.  Check out the above.   If you still have issues, let us know,  if you fixed the problem, please let us know how you did it.

Thanks,
Steve


Anthony Barnett

unread,
May 22, 2014, 9:35:18 AM5/22/14
to mitappinv...@googlegroups.com
how do i tell how big it (is) will be when compiled if i can't compile it ?
the .apk file was around 1.4mb before the resize
the resize is only about 1 screen of blocks on each screen on app, 2 screens
surely that wont be 3.6mb 
when you say did i upgrade to aicompanion 2.18 what do you mean
i have the latest ai2 companion on android phone, app works fine
the programming/compiling is done through browser on the cloud as it were
i have tried a couple of times over an hour and on chrome and firefox
sometimes fails at 25% sometimes 95%, or anywhere in between

SteveJG

unread,
May 22, 2014, 9:53:01 AM5/22/14
to
Hi Anthony,

Can you make an aia file?   If you cannot compile the apk, the debugger might not allow you to make an aia.   However, if you can download the aia, download it, then check the file size of the aia.  With Windows, right click the *.aia file, then select Properties.

The smallest size of an AI2 app is around 1.25 Mb.  

Do you have aiCompanion version 2.18?    from browser window,   Help > About       Does it show version 2.18?     If not, try  Connect > Hard Reset   from the browser and follow the instructions.  After it finishes, close your browser and restart.

Do you have red triangles > 0?     Really need to know this.

Can you compile any other of your Projects?   Knowing this helps us narrow the possibilities.   If you can compile others, it implies something is at issue with your code Blocks.

If you will answer again to best of your ability and provide the name of your project , it will help technical staff to get involved if necessary.

Using both FF and Chrome was a good idea.  Sri it did not work...sometimes one browser will work in certain situations while the other will not.

OK... get back to me and let us see if we can get this fixed.

Regards,
Steve

Anthony Barnett

unread,
May 22, 2014, 10:17:09 AM5/22/14
to mitappinv...@googlegroups.com
Hi Steve

ok help>about shows
Built: May 18 2014 Version: nb133
Use Companion: 2.18ai2zx1

i assume this is ok from your original post

the red/yellow triangles, no errors for both screens

how do i make .aia file?
option is only to import one from computer



Anthony Barnett

unread,
May 22, 2014, 11:03:13 AM5/22/14
to mitappinv...@googlegroups.com
also the .apk file for my latest beta version which had auto resize for screen 1 only, was only 1.41mb
that was up from 1.39mb for the version without auto resize
so i would expect the screen 2 update to be little more than the same rise probably still less than 1.5mb
this is the first app i have made, but earlier versions always compiled ok



SteveJG

unread,
May 22, 2014, 11:09:14 AM5/22/14
to mitappinv...@googlegroups.com
Here is a resource you might enjoy perusing:  http://appinventor.mit.edu/explore/library   .    It explains lots of not obvious things about AI2.

This explains how to make an aia file.   To do so, be sure to open Projects, then check the box next to the Project you want to create the aia for ... then return to Projects  and  the Select project aia file will become enabled... just do what it says here:

Sharing your app so that others can remix (.aia file)

Make sure you are viewing the list of all of your projects (if you are not, choose Projects | My Projects). Select the project you wish to share by checking the box next to it. Choose Project | Export selected project (.aia) to my computer to export the source code (blocks) for your project. The source code is downloaded in a .aia file.

If you send it to a friend, they can open it with Project | Import project (.aia) from my computer.

Sharing your app for others to install on their phone/tablet (.apk file)

Package the app (.apk file) by going to the "Build" menu on the App Inventor toolbar.

Select "App (save .apk to my computer)." A pop-up box should alert you that your download has begun. Note: The other option (provide QR code for .apk) produces a scannable QR code that will download the app ONLY for the person who owns the project in App Inventor. Do not distribute the QR code to others because it will not work for them.

Once the build completes, you can email the app (".apk" file) to your friends who can install it by opening the email from their phone. If you want to distribute it more widely, you can upload it to a website that both you and your friend can access. You can also distribute your app on the Google Play Store.

NOTE: Anyone installing your app (which is an ".apk" file) will need to change the setting on their phone to allow installation of non-market applications:

To find this setting on versions of Android prior to 4.0, go to "Settings > Applications" and then check the box next to "Unknown Sources". For devices running Android 4.0 or above, go to "Settings > Security" or "Settings > Security & Screen Lock" and then check the box next to "Unknown Sources" and confirm your choice.

Note: The source code (.aia) files are not executable Android programs -- those are .apk files. The source code is also not Java SDK code -- it can only be loaded into App Inventor.

SteveJG

unread,
May 22, 2014, 11:13:21 AM5/22/14
to mitappinv...@googlegroups.com
OK, understand about previous versions, however, now you have a new version.  I can't give u a technical explaination of why these gremlins exist, what I can do 
is point you to the things that cause issues.   AI2 is what it is.

Could you please provide the name of your project?       If you can produce an aia file, I would be glad to look at it.   However, I will also advise the technical staff of your issue
if it is not possible for you to create the aia.and THEY really NEED your project name to help.

--Steve

Anthony Barnett

unread,
May 22, 2014, 11:29:22 AM5/22/14
to mitappinv...@googlegroups.com
ok i have made a .aia file now
do you have an email address to send it to?
Project name is SWR

SteveJG

unread,
May 22, 2014, 11:32:17 AM5/22/14
to mitappinv...@googlegroups.com
Very good u got an aia.   I will look at in a little while at your standing wave ratio app I guess.    I am sending u an email...respond to that address Tony.

SteveJG

unread,
May 22, 2014, 12:16:33 PM5/22/14
to mitappinv...@googlegroups.com
Tony, I can not get this aia to compile either.   I tried deleting things but nothing worked.

I suspect some of your screen conversions .. what I did experience was high memory usage ... I have 6Gb   so something may be corrupted.

I suggest you rename the project ... Save as option    and then start deleting things.  

for the moment, it is time for lunch here.    I sent a note to one of the tech staff so he will respond whenever he gets free.

Pretty neat app it appears.  Hopefuly some one can figure the issue, I suspect AI2 can not handle some of the screen changes.  Experiment using a fresh project name (so you do not make matters with this project worse) until someone comes back with a better suggestion.

I may look again after lunch but I am not hopeful...I suspect this:There are several situations where this error has been observed. One is with large projects that have multiple screens: The individual screens build correctly, but the system runs out of space in putting all the screens together at the final packaging. Another situation is where the project file is corrupted, for example by the user unzipping it making an edit and then re-zipping it. This can lead to spurious files being included in the new zip file, which confuse the compiler. Another might be bad names for figures or other assets, that can trip up the compiler.

If your project gets this error, think about whether there could be causes like the two listed above. If that doesn't help, try asking in the Forum: You'll need to attach your project source so that someone can try to diagnose the problem.


but do not know how to help.


-- Steve

SteveJG

unread,
May 22, 2014, 12:50:33 PM5/22/14
to mitappinv...@googlegroups.com
Tony, was the maniffest modified with AppToMarket or something else?

I have deleted a lot of stuff, the app still runs but when I try to compile the apk get the errors.    Another issue might be the ads are causing issues.   I do not know.

Anthony Barnett

unread,
May 23, 2014, 5:37:22 AM5/23/14
to mitappinv...@googlegroups.com
The app is published on google play with the ads on both pages so i am pretty sure it's not that
the only change i have done, and all using AI2 were the screen size changes
i will try deleting what i have done and see if it compiles again and at which point
Thanks for looking and trying your best for now
will get back with results later

Anthony Barnett

unread,
May 23, 2014, 5:40:24 AM5/23/14
to mitappinv...@googlegroups.com
btw the app idea i got while at a show for work, was giving away promotional 'real world' copy of the wheel, and one guy said, i'll take one but i'm waiting for the app to come out.
looked it up and found nobody had done it, so gave it a go

Hal Abelson

unread,
May 23, 2014, 7:53:33 AM5/23/14
to mitappinv...@googlegroups.com, Scott Ferguson
Tony,

This is a weird one.  the problem is with what you put as version name:  12 help & auto resize

The Google documentation says that version name can be anything, but apparently the ampersand is blowing out the Google compiler.
My guess is that something is trying to scan that string as HTML, because changing "&" to "<" works.
We'll put a check into App Inventor to watch for this.

Anyway, just change the version name to say "and" instead of "&" and things should work.

== Hal

Anthony Barnett

unread,
May 23, 2014, 8:16:45 AM5/23/14
to mitappinv...@googlegroups.com, Scott Ferguson
ah yes well spotted Hal
thanks, works perfect now
always the real simple errors that cause the most problems !
should have realised from doing HTML before although browsers are quite forgiving these days


Anthony Barnett

unread,
May 23, 2014, 8:17:59 AM5/23/14
to mitappinv...@googlegroups.com, Scott Ferguson
and thanks again Steve for also trying

SteveJG

unread,
May 23, 2014, 8:25:35 AM5/23/14
to mitappinv...@googlegroups.com
Glad you are up and running again Tony.

-- Steve
Reply all
Reply to author
Forward
0 new messages