Skip to first unread message

Callum Hoare

unread,
Sep 16, 2015, 10:23:35 AM9/16/15
to MIT App Inventor Forum
I don't know why but when I put the .APK file on my phone, the installer crashes.
My Android version is 5.1
My phone is a Moto G 1st gen
Also I haven't modified or rooted it in any way.

I've tried installing other apps though installing their APK's and all have been successful. (Not from AI2)

Please fix,
Thanks
Screenshot_2015-09-16-15-13-37[1].png

Italo

unread,
Sep 16, 2015, 11:35:10 AM9/16/15
to MIT App Inventor Forum
Have you tried a different package installer? Is that one on the screenshot, the stock one?

Vincent

unread,
Sep 17, 2015, 9:19:05 AM9/17/15
to MIT App Inventor Forum

Hi,
I meet a similar issue...one apk published by AI is crashing the installer, but other apk published by AI don't...
If I test the app through the AI companion, I don't have any issue... Callum, did you try with AI companion?
Here is the part of the system log:

Vincent

unread,
Sep 17, 2015, 10:41:53 AM9/17/15
to MIT App Inventor Forum
Hey...I just fixed it after reading some google pages...
The picture I used for the icon was 1.9Mb. AI was not complaining about when uploading & selecting BUT when I just resized the picture to a 25kb size, the app installer is not crashing anymore..
Callum, I hope it'll help you also...
Regards,
V

jorge soto trejo

unread,
Sep 17, 2015, 12:00:24 PM9/17/15
to mitappinv...@googlegroups.com
I CAN NOT  BUILD MY APK FILE, SERVER ERROR

SteveJG

unread,
Sep 17, 2015, 12:27:39 PM9/17/15
to mitappinv...@googlegroups.com
Jorge, what does your question have to do with the topic of this thread?  You are having issues building, not installing an apk.    You are new here, what the Forum likes is for you to start a new thread.   Welcome to the Forum and rather than start a new thread .  I am providing a very long answer because you did not tell us anything about your app, post a screen shot of blocks or tell us any of the things we need to know to help and others might find this information useful.

So, here it comes...

One of the following  possibly applies to your code (all may not apply to your code because this includes emulator issues and aia issues, not only the ability to build an apk.   However the other issues sometime inhibit building the apk too..):


The following is mostly the same information with some additions.   Hope it helps.


 1) You have coding errors in your blocks.  In the Blocks editor, look in the lower 
left corner of the window for the yellow and red triangle icons. If the red icon has a value 

larger than 0, you have a serious coding error.  Find the block in your code that has a red 

triangle and fix it.   Red triangles always inhibit creating an apk or running a project in the 

emulator or possibly creating an aia file. Yellow triangles are more forgiving, however, 

sometimes, these need to be fixed because they trip an internal warning and not filling puzzle 

piece sockets that are left un-filled can sometimes cause issues if the app needs a value that is 

not filled.

2) Your source file (the aia file) is larger than the 5Mb limit allowed in AI2 (the aia can not 

be larger than 5Mb). You may have put images or other resources in your Media (resources) that 

you do not use in the app.  All the images and sounds in resources count toward the 5Mb limit 

along with the source code.    You can program apps larger than 5Mb in the browser, but the apps 

will not compile and might not run in the emulator or the project may not save as an aia. If this 

is the case you need to reduce the size of your image and/or sound files.   Most image files can 

be made quite small by resizing them using a photo manipulation program on your PC to less than 

50Kb each.

3)  You might have more than 10 Screens in your app.  AI2 becomes unstable when more than ten 

screens are used.  Projects CAN be built with slightly more screen but then you should expect 

your app to occasionally behave erratically.

4) You might have set a Screen icon in the Designer Properties for your project that is too 

large. Use an image size of 48x48 pixels instead. Only use jpg or png images.  *.ico files are 

not supported.  The 'icon' (actually an image) Google Play requires when posting needs to be 

520x520 for their display.  The smaller 'icons' work for the app's icon (the one shown on the 

device's screen that is pressed to activate the app.

5) You did not code the entire project using App Inventor 2.   If you used one of the third-party 

AI2 clones,you might not be able to load a Project into the AI2 compiler or create an apk with 

the standard AI2.

6) If you incorrectly modified the project's Manifest files using a third-party tool, you may 

have issues.

7)  Sometimes, if you have LOTS of Layouts on a single screen,  the apk might not compile. How 

many is a lot?  I do not know, keep adding layouts and buttons, compile and try again...when the 

server crashes, you got a lot.

8)  The network you use may be overloaded (possibly a school network), or you have other 

applications running in the background on your computer, or your virus checker is doing a scan.  

Sometimes, just trying to access the MIT server a few minutes later will give you a more 

favorable response.

9) Do you have BlueStacks on your PC (BlueStacks is a special emulator that allows Android apps 

to run on a PC)?  The Google emulator on AI2 cannot run unless BlueStacks is disabled and all of 

the BlueStacks processes are shut down.  On a Windows PC, you use the Task Manager to 'kill' 

running processes.

10)  Are you using Sensor controls (except for the clock)?   Most Sensor controls or controls 

related to sms or the phone do not work in the emulators.  These include the LocationSensor and 

Accellerometer.  These components need to be tested on a device.

11) If this is an issue about the Project loading slowly on your device or on the emulator:  Be 

aware, the more images, layouts, components you have on a screen, the longer it takes for the 

emulator and Companion to render the graphical screen.  How fast the emulator renders is 

partially a function of your hardware...how much ram you have, your cpu clock speed etc. 

Sometimes, with lots of graphics, the emulator will just give up.   Can you develop live using 

WIFI or using USB? These options almost always render faster than the emulator but will not be at 

lightning speed if you have lots of graphics.  Be patient.

12) We have seen instances where it is probable the Google Cloud messed up; other instances where 

an older PC has had memory issues and caused file corruption of the Project and instances where a 

user is using a very slow Internet connection (like dial-up) and it is just too slow.

13)  Do you have an AVG, Eset or AVAST virus checker.  Some versions of these products have been 

reported they inhibit running the emulator unless (in the case of AVG) the Advanced Link settings 

on the software are set to allow AI2 communication.


14) Do you get the error:  The blocks area did not load properly. Changes to the blocks for 

screen xxxxxxx_Screen1 will not be saved.  One user had this error, the problem was he had too 

many comment boxes exposed at once for the browser to handle.  Try minimizing all blocks, and 

opening in another browser,like Chrome or Firefox.

16)  Having issues getting AI to run at all, perhaps your firewall is blocking.  Don't turn your 

firewall off, just allow AI2 to pass unhindered..some firewalls have the ability to allow or deny 

certain urls.

17)  If you get a build server busy ... In this particular case the buildservers may just well be 

busy! If you get this message, just try the build again.  MIT currently runs 3 buildservers all 

the time. They occasionally add a 4th or even a 5th. There is a load balancer which distributes 

work to the buildservers. If you get the "busy" message, either the load balancer could not find 

a buildserver with available resources or the the buildserver it assigned the request to decided 

it was too busy.  The solution is to just try again, either immediately or in a few minutes.  If 

this message persists, then something might be broken and you can report it on the forum.   If 

something IS broken, MIT will find out about it soon enough!


18)  If you have excessive resources, you can look at what is in the emulator. In both in the 

Companion via WiFi and in the emulator, with the emulator "up" you should be able to go to: 

http://127.0.0.1:8001/ on the PC running the emulator. Going to that url should show you a small 

(possibly empty) directly listing (it will be a list of the assets that are used in the 

emulator).

19)  You might have used an alpha character in the app's Version number.  The version number must 

be all numerical digits.  Use of an alpha character will spawn a generic error message on 

attempting to compile.

If the connection times out, that is a problem! The aiStarter program uses the "adb" program (in 

the "commands-for-AppInventor" folder) to setup "tcp port forwarding" from the PC to the emulator 

on port 8001. This command could be failing for you. Make sure you don't have security software 

that is blocking the action of the "adb" command.


19)  The problem could be something else, like running an old version of Companion ...if this is 

the case with the emulator the cure might be:   Projects > Hard Reset.  If there are Companion 

issues, a pop up will appear (if no issues, nothing will happen...just smile).  When the pop up 

appears, follow the instructions very carefully, then reboot your PC and try again.   If 

developing on the device, upload the latest Companion from Google Play.

20) If this is a connection issue with WIFI: If the device is set up to be used with USB, the 

Android cannot be used with WIFI unless the Settings > [developers options]  in the Android  box 

next to  USB debugging is unchecked.  
  
Some users try to use their phones BOTH with USB and WIFI.  That can be done.  To use the live 

development USB option the developer must have the USB debugging box checked.  If developer later 

wants to use WIFI the USB debugging box should NOT be checked.

21) Parse Error:  The most common cause of a parse error is the device has run out of storage.   

Do you have  lot of apps on your emulator?  Try freeing up space there (clear the TinyDB 

perhaps-TinyDB.ClearAll), and see if that helps.

A  type of parse error may occur while attempting to update the emulator:  You got the "parse 

error" message in the emulator, you can fix it by..
- uninstalling the aiStarter setup tools via the Control Panel
- rebooting
- re-running the install file, but this time by right-clicking on it and running as an 

administrator


   
22)  Do you have lots of Windows open on your browser or are you streaming music or video?


23) Large bmp files ( 1 to 2 MB in size, 800 x 1500 pixesl)loaded into a button that is 50 x70 

pixels will cause Companion to fail when loading a project.  The issue is AI2 must compress these 

to the small size to make them fit in the small area.  The solution is to make these files 50 x70 

pixels (or however large they must be in on the Android).


24) ai2 reports "Server error. Could not save one or more files."
Clear your browser's cache.  Close the browser, then load it again.  Try to build again.

Several very different things seem to evoke the package installer has stopped message.1) Using a 

app icon larger than 48 x 48 pixels (the png or jpg image you use to identify your app on a 

device set on the Designer screen). will evoke this issue.  Use a 48 x 48 jpg or png image. This 

is a very frequent issue that evokes the error.2) Removing unused files from Media (even though 

the aia is less than 5Mb) has curred the issue.3) If the apk installs on other phones, but not 

this one perhaps there isn't sufficient space on the phone.  If the apk installs on other phones, 

it is not an issue with the  apk. You may have too many apps on your device.

----------------------

You may also have to refresh your internet connection.  Unplug the modem and router.  Wait 30 

seconds, then plug the modem in again, then the router, in that order.   or you may have to go to 

the Settings in your Android and make sure WIFI is turned on (sometimes an error can occur while 

testing an app and the WIFI gets turned off ...not frequently but it can happen.)

26) Often, when there are errors putting an APK on a device, the error is related to system 

memory.  AI apps require memory at least 4 times the size of the APK to install.  Make sure you 

have enough INTERNAL memory available on your device. You may have to un-install a app you are 

not using.

27)  Adding special characters in ApplicationName, will cause application build errors.

28)if a smartphone is connected via internet wifi mode and the computer is connected with the 

smartphone via tethering. Run the Companion on the smartphone and  try to connect the phone to 

the computer with the QRcode, before pressing "connect with code", the browser indicates "an 

internal error has occured.   How the devices must connect is explained here:  


It is possible to connect using a Wireless hot spot.that connects both the phone and the PC to 

the hotspot.  That is expensive on most networks.  It is what some organizations do to have AI2 

Development Workshops working with several students.

You might be able to use the PC to work with the emulator  and/or    use the phone using the USB 


29 ...inability to load a project with Firefox: ...close scripting plug in.

30)  Maybe you have multiple copies of adb.exe  running if you are having emulator problems?

Check with Windows Task Manager and kill them all, then start a fresh aistarter.


Is anything familiar?

Regards,
Steve

Reply all
Reply to author
Forward
0 new messages