App not working as an ".apk" file on the phone

65 views
Skip to first unread message

Gabriel Fausto Chaves

unread,
Apr 16, 2019, 5:41:17 PM4/16/19
to MIT App Inventor Forum
Hello everyone,

I have developed an app, which works perfectly while running the AI Companion Emulator together with it. However, when I build a project, being either saved to my computer or via QR code in .apk format, it simply doesn't work on my phone.

I've already tried to connect with the "blocks" open, and even so, it remains the same.

Here's my ".aia" file:

https://www.dropbox.com/s/pyut3onc3auroti/AppTeste.aia?dl=0

Could anybody help me, please?

Thank you.

Taifun

unread,
Apr 16, 2019, 5:42:56 PM4/16/19
to MIT App Inventor Forum
 it simply doesn't work
can you elaborate on this please?

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to  App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 



Gabriel Fausto Chaves

unread,
Apr 16, 2019, 6:04:36 PM4/16/19
to MIT App Inventor Forum
Hello,

Thanks for answering me.

I'm trying to post screenshots here to explain what I mean, but can't find anywhere in the message box to do it. Can you help me?

Chris Ward

unread,
Apr 16, 2019, 7:28:39 PM4/16/19
to MIT App Inventor Forum
Hi Gabriel

How to make an image of your App Inventor Blocks View:

Gabriel Fausto Chaves

unread,
Apr 16, 2019, 7:35:50 PM4/16/19
to MIT App Inventor Forum
Hi Chris,

Thanks for answering, but I mean... how can we upload a file or image HERE while posting the message? I mean, there's no button to "attach" or "copy and paste" in the box while texting the message to post. Do you know how to do that?

Many thanks.

Chris Ward

unread,
Apr 16, 2019, 7:40:00 PM4/16/19
to MIT App Inventor Forum
Gabriel

Your project file is large because a lot of the media is too big. You also have file types .ico that are not supported by Android so they should not be in your Project at all.

The reason why the App runs under the Emulator on your PC is that a PC's processor and ram can handle very large files, where as a small device like a phone does not have the same capability (aka "grunt").

When you say the APK does not work on your phone:
does it install?
If it does install, when you try to run it is there an error message?

It could be the case that it is just taking a very long time to initialize, because of the over-size images.

I have a guide on my website on how you must optimise your images:

Be sure to delete the unused media from your Project.

Chris Ward

unread,
Apr 16, 2019, 7:42:22 PM4/16/19
to MIT App Inventor Forum
...That is what this guide does, gives you step-by-step instructions on how to make a high resolution image of your Blocks and post it here :)

https://www.professorcad.co.uk/appinventortips#TipsBlocks   How to create an image of your Blocks and add it to your Forum Post

Gabriel Fausto Chaves

unread,
Apr 16, 2019, 7:44:00 PM4/16/19
to MIT App Inventor Forum
Hi Chris,

Thanks again. However, what I mean is...

Well, I need to show some Screenshots of what happens here in the forum while asking you guys so that I get understood. However, I don't know how to post here an image. How to attach here a file or an image, so that you could help me.

How can I do it?

Thanks.


Chris Ward

unread,
Apr 16, 2019, 7:48:41 PM4/16/19
to MIT App Inventor Forum
..another issue is that you must not have any incomplete/empty Blocks:

EmptyBlock.png


If you need this Block, complete it - otherwise delete it.


Chris Ward

unread,
Apr 16, 2019, 7:55:09 PM4/16/19
to MIT App Inventor Forum
Screen Voc has a huge amount of work being done on Screen Initialize, so the whole App will take some time to load and display. The "If Then" Blocks could possibly be replaced with a multi-component loop (more efficient, faster, less human error) but let's see how things are with the images optimized. 

ABG

unread,
Apr 16, 2019, 10:45:08 PM4/16/19
to MIT App Inventor Forum
To attach an image file to your post,
start the POST REPLY dialog, and click on the link
to attach a file (see my attached image.)
Your browser will open up a panel to
receive a drag and drop.
Minimize everything (Windows-M) and
locate the image file, then drag it
onto the browser's Task Bar tab.
When the browser opens its mouth for the file,
drop it in.

ABG
Capture.PNG
nom nom nom.PNG
yummy.PNG

Chris Ward

unread,
Apr 17, 2019, 3:12:13 AM4/17/19
to MIT App Inventor Forum
Hi Gabriel

Please do not send emails directly to the Power Users, we do not respond to direct communications.

This is because, by keeping the discussion on the forum, there are many people from all around the World (different time zones) who can potentially help you, not just the first responder, who may be unavailable. Plus, there is often something that many forum members can learn by reading the posts.

Be aware that the Power Users are here to help you to help yourself. We are volunteers and we want to see everybody do well and enjoy programming with AI. So, please post to your forum thread for further help.

Chris Ward

unread,
Apr 17, 2019, 3:18:10 AM4/17/19
to MIT App Inventor Forum
Hi again Gabriel

I have pin-pointed issues in your Blocks, especially the large image files, as a possible cause of the issue when the APK is installed. At the moment, the device has to decompress large image files to memory, and some files included (.ico) are not supported by Android - so I think it is possible that when the App is run, memory corruption might occur. I could be entirely wrong, but exactly that has happened to other Users and the images were the cause. 

So, clean-up your Project exactly as per my advice - at the very least, your app will load faster and be more stable.

Gabriel Fausto Chaves

unread,
Apr 17, 2019, 5:57:54 AM4/17/19
to MIT App Inventor Forum
Hi,

I really appreciate your help, but such buttons don't appear for me when I post here. I'm gonna try to access the same forum, but in a different way to see if that works.

Thank you.

Gabriel Fausto Chaves

unread,
Apr 17, 2019, 5:59:54 AM4/17/19
to MIT App Inventor Forum
Hi Chris,

Thank you very much for helping me. I'll check it out. Maybe the problem is in the (.ico) images.

Gabriel Fausto Chaves

unread,
Apr 17, 2019, 6:04:52 AM4/17/19
to MIT App Inventor Forum
Hi Chris,

Thanks for the tip. I mean, I tried lots of times to post here, but couldn't find a button to attach my images and files in order to get myself understood, this is why I sent you an e-mail.

I'm gonna find it one day, haha. Thanks, Chris.

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Gabriel Fausto Chaves

unread,
Apr 17, 2019, 6:40:55 AM4/17/19
to MIT App Inventor Forum
Hi everyone, 

I'm having a problem with my app, and I really appreciate if you could help me. I finally got posting here, yeah (:

Let me tell you exactly what it's happening:

When I run my app with MIT Companion, click on "Intro" and after "vocabulary", it happens something like this (img 1).

I can run through the questions with no problem, and my logic works perfectly, so I have this (img 2) or this (for wrong answers -  img 3):

I can go through all the questions with no problem. However, when I download the ".apk" file from the navigator and install it on my phone, then when I click on the same "Vocabulary" button, it shows the following error (img 4)

and then this (img 5).

I have no idea why it works perfectly in MIT Companion simulation but not in the downloaded .apk file installed.

Do you have any idea? Attached it my .aia file.

Thanks.
img 2.png
img 3.png
img 4.png
img 5.png
img 1.png

Gabriel Fausto Chaves

unread,
Apr 17, 2019, 6:44:07 AM4/17/19
to MIT App Inventor Forum
Hello Chris,

I tried removing the (.ico) image files, and even so, it didn't work. This is not my full app, I simplified it a lot in order to try to isolate the problem.

TimAI2

unread,
Apr 17, 2019, 6:59:24 AM4/17/19
to MIT App Inventor Forum
You have a list problem
Need to see your blocks
Right Click in Blocks Editor and select "Download Blocks as Image"
(use image editor to crop etc. if required)

Message has been deleted

ABG

unread,
Apr 17, 2019, 10:44:09 AM4/17/19
to MIT App Inventor Forum
One of your screen images shows nested lists in an error message.

They look like questions with ___ for filling in blanks.

How do you load those?

Are they pulled in from Media folder Files,
or are they hard coded in text blocks?

ABG

Chris Ward

unread,
Apr 17, 2019, 11:38:39 AM4/17/19
to MIT App Inventor Forum
Tim, ABG

Guys, take a look at the aia Gabriel has posted. This is what my comments were based on. In particular, the image files need to be addressed.

Chris Ward

unread,
Apr 17, 2019, 12:20:45 PM4/17/19
to MIT App Inventor Forum
Hi Gabriel

Concerning posting an image of your Blocks, are you saying that you do not see the "insert image" button when you post to your forum post as shown in my step-by-step guide?

Add image to post.png


ABG

unread,
Apr 17, 2019, 12:49:14 PM4/17/19
to MIT App Inventor Forum
Okay, I found the .aia in the first post.

Screen VOC looks like a box of combs.

But from the symptoms
(works in Companion, not on device)
it might be a TinyDB default value problem.

Need to see the bottom of that error message.

ABG

blocks.png

ABG

unread,
Apr 17, 2019, 12:59:42 PM4/17/19
to MIT App Inventor Forum
What are those pdf files doing in your Media folder?

I see no way to read them.


Also, the circled check against the number 301 will
blow up in your face when you forget about it and
add or remove a question.
Better to use the length of list block for flexibility.

because you left all the data in your blocks,
it makes it all tedious to work with in the Blocks Editor.
Sample table driven app ...

ABG


pdfs without a way to use them.PNG
hubris 301.PNG

Gabriel Fausto Chaves

unread,
Apr 18, 2019, 7:49:09 AM4/18/19
to MIT App Inventor Forum
Hi Chris,

Thank you very much.

Gabriel Fausto Chaves

unread,
Apr 18, 2019, 7:51:08 AM4/18/19
to MIT App Inventor Forum
Hi ABG,

Thanks for taking a look at this for me. I'll post a new image with the bottom part of the error message.

Gabriel Fausto Chaves

unread,
Apr 18, 2019, 7:54:32 AM4/18/19
to MIT App Inventor Forum
Hello ABG,

Thanks for the comments. I mean... this "magic number" is because each section/module of the app is supposed to have 300 questions. Other files are uploaded although they are NOT used, because actually it's a much larger app, but I simplified it in order to try to isolate the problem with the arguments while running as an ".apk" file.

 

Gabriel Fausto Chaves

unread,
Apr 18, 2019, 7:58:27 AM4/18/19
to MIT App Inventor Forum
Hi ABG,

They are hard coded from text blocks. I tried using an Excel file, but it didn't look properly for design purposes.

Many thanks.
Reply all
Reply to author
Forward
0 new messages