Cannot find component: Screen 2

1,057 views
Skip to first unread message
Assigned to ftu...@wellesley.edu by taifu...@gmail.com

Ido Marko

unread,
Oct 2, 2018, 6:28:16 PM10/2/18
to MIT App Inventor Forum

Hi,

I’m using app inventor 2. I have a back up of an app from app inventor 1 and tried to update it on ai2. for some reason it says now “Cannot find component: Screen 2” although I didn’t change anything and there is a “Screen 2” - any thought on what I should do?
(The same thing happens with all the screens)

Thanks in advance

Capture1.PNG

Abraham Getzler

unread,
Oct 3, 2018, 11:28:34 AM10/3/18
to MIT App Inventor Forum
Have you opened all the screens in the Designer and Blocks Editor since
running them through the converter?

Sometimes there are updates that need to be applied to a project
as AI2 evolves.

If that doesn't work, check for leading or trailing blanks
in the text block 'Screen2'.

Also check elsewhere to see if there is another block 'Screen 2'
in your app.

If that doesn't work, post your exported .aia here for us to see.

ABG

Ido Marko

unread,
Oct 3, 2018, 11:36:11 AM10/3/18
to MIT App Inventor Forum
Thanks for replying.
I did try to run each screen alone and it worked but when I try to open a screen through another screen it doesn't work.
I doubt that the error is from blanks because I did try to redo the blocks.
Any other thoughts?

Thanks in advance!

Abraham Getzler

unread,
Oct 3, 2018, 11:47:38 AM10/3/18
to MIT App Inventor Forum
Further analysis requires hard data...

Error Screen shots, .aia, downloaded Blocks Images, etc.

ABG

Chris Ward

unread,
Oct 3, 2018, 1:00:18 PM10/3/18
to MIT App Inventor Forum

Ido Marko

unread,
Oct 3, 2018, 2:59:03 PM10/3/18
to MIT App Inventor Forum

This is The error Screen I get.




Screenshot_20181003-215043.png


This the block:

Capture1.PNG


After I've converted from AI1 to AI2 there is a new screen that is called DO_NOT_DELETE, maybe the problem is related to that somehow?

Capture.PNG

Capture3.PNG

Hope we can figure something out - Thank you!

Abraham Getzler

unread,
Oct 3, 2018, 3:26:30 PM10/3/18
to MIT App Inventor Forum
Export the .aia file and post it here.

ABG

Chris Ward

unread,
Oct 3, 2018, 3:59:13 PM10/3/18
to MIT App Inventor Forum
Hi Ido

What is going on with Screen1? Are you using it as a Splash Screen? 

Try this:

ClockProperties.png


blocks.png




Boban Stojmenovic

unread,
Oct 3, 2018, 7:56:40 PM10/3/18
to MIT App Inventor Forum
Can i ask why are you trying to open screen 2 on initialize when you have a lot of components trying to do things...

Btw, try removing open screen2 on initialize and se what happens.

/Boban
Message has been deleted

Chris Ward

unread,
Oct 4, 2018, 5:36:08 AM10/4/18
to MIT App Inventor Forum
Hi Ido

The Do-Not-Delete items are put there by the AI1 to AI2 converter. Not much info inside but their names suggest they are important to the compiler/MIT.

I'm going to test the Project here to see what I can find.

By the way, the image "robot.png" is way too large to be the App icon (and should be square). 

Chris Ward

unread,
Oct 4, 2018, 6:54:46 AM10/4/18
to MIT App Inventor Forum
Hi Ido

The Block that opens Screen2 to Splash the DoDo is indeed on Screen1. So, I added a new Clock as per my previous code snippet (see above) and that does seem to have fixed the issue. Apart from the fact that I don't have a Robot and get warning messages about that, an API 2.1 debug APK is working on my phone -nice graphics.

Two other changes:
  • The Do Not Delete Block had an un-connected text block. I attached it to a variable.
  • I made a seperate 92x92pix image for the icon.
NXTDrive_02.aia

Chris Ward

unread,
Oct 4, 2018, 6:57:44 AM10/4/18
to MIT App Inventor Forum
.... If it's still not right, I would say start a brand new AI2 Project. You can copy the Blocks over via the BackPack one Screen at a time and it would not take long to redefine the GUI.
A 2-3 hour task?

Ido Marko

unread,
Oct 4, 2018, 11:26:32 AM10/4/18
to MIT App Inventor Forum
It is working now! Thanks a lot!

I must say I am really amazed by how much you guys have been willing to help - Thank you!

Ido Marko

unread,
Oct 5, 2018, 11:47:53 AM10/5/18
to MIT App Inventor Forum

Hi guys,

I realized what to lead to the bugs, but I don't know why they happen.
The app version that wasn't working was the google play store version. When I build the app for the google play is still shows the same errors - any idea why?
If I build just an "App" it doesn't show all the bugs.

Thanks again,

Ido

Boban Stojmenovic

unread,
Oct 5, 2018, 12:08:08 PM10/5/18
to mitappinv...@googlegroups.com
Update of the existing file that Cris Ward did as well as with my changes as it should look like..

This worked for me on Android 7 and 8 that I have tried with build for Google play

edit
I hope will you understand what I've done with your app and code.

However, disappointed that OpenScreenAnimation is not working as it should, screens only opens from right to left no matter what you change to.

edit2
I just realized that the Bluetooth client isn't working and hence empty list of devices..

/Boban
NXTDrive_03.aia

Ido Marko

unread,
Oct 6, 2018, 4:12:25 PM10/6/18
to MIT App Inventor Forum
I don't get it - why are the google play version is so different? why isn't the Bluetooth client working? Plus I've noticed Boban that on your version my ads don't work as well... I'm really frustrated with AI2

Boban Stojmenovic

unread,
Oct 6, 2018, 9:52:22 PM10/6/18
to mitappinv...@googlegroups.com
 I don't get it - why are the google play version is so different? why isn't the Bluetooth client working?
 It's like trying to put a Ferrari engine in a Fiat, some parts don't fit


As part of supporting SDK 26, the MIT App Inventor Team had to make changes to some of our components in order to display the
appropriate permission dialog boxes. We also had to make other changes in order to be compatible with SDK 26. These updates are still pretty
new and the code is not as tested as we would like it to be prior to release. However with the update needed by August 1st, 2018, we are
choosing to release this code in the state it is.

What this means is that after you package an application for SDK 26, you should test it to ensure it looks like you wish and that all functions
work as expected. If you discover any problems, please report them via the MIT App Inventor Forum. We will be updating the buildservers for SDK
26 as we find and fix bugs.


Plus I've noticed Boban that on your version my ads don't work as well.
Works for me


/Boban
Screenshot_20181007-035201.jpg

Ido Marko

unread,
Oct 8, 2018, 11:47:27 AM10/8/18
to MIT App Inventor Forum
I still don't understand why does Screen2 open on your project but on mine it doesn't? What is the difference? I'm uploading my current aia
NXTDrive.aia

Boban Stojmenovic

unread,
Oct 8, 2018, 12:40:34 PM10/8/18
to MIT App Inventor Forum
This is the only thread I haven't mentioned this, make sure that when switching screen - for all of your clocks/timers, set TimerAlwaysFires to false if you have any and TimerEnabled to false

/Boban

Ido Marko

unread,
Oct 10, 2018, 12:40:35 PM10/10/18
to MIT App Inventor Forum
Oh great, now it works! But I wonder why app inventor doesn't give us a better alert regarding this problem - writing "Cannot find Component Screen2" is just not enough information in my opinion...
Plus, does anyone knows why does the Bluetooth client doesn't work?

Chris Ward

unread,
Oct 10, 2018, 1:44:35 PM10/10/18
to MIT App Inventor Forum
Hi Ido

Concerning the error message, there are so many things that can go wrong, the list of messages would be almost infinite - and that's assuming somebody can look into the future and anticipate that a certain combination of circumstances will lead to a single definable issue. In short, it's massively difficult.

Bluetooth client doesn't work? We need a bit more information. Could you open a new Post please? It is a different subject.....

A guide to posting on this Forum:
Reply all
Reply to author
Forward
0 new messages