iOS build server updated to 2.64.6 (2)

Hello everyone,

The iOS build server has been updated to match TestFlight version 2.64.6 (2) (see here for relevant changes). In addition, the following buildserver specific issues should be resolved:

  • Fix Screen.Initialize and other events not firing correctly
  • Fix a screen switching issue
  • Fix an issue that could affect app layout on initialization
  • Show app icon in launch screen rather than default App Inventor logo

Builds are now being done with Xcode 15.2 and iOS SDK 17.2.

Regards,
Evan W. Patton, Ph.D.
Lead Software Engineer, MIT App Inventor

2 Likes

Great, I'll start testing tomorrow and give feedback.

How are screens navigated on AI2 für iOS? Let's assume there are 3 real screens (Screen1, Screen2 and Screen3) and you can switch from each screen to the other two. I noticed that when switching from Screen2 to Screen3 and Screen3 to Screen2, Screen1 always becomes visible briefly before the target screen is opened.

To avoid this, do you ultimately have to create virtual screens (i.e. vertical arrangements/layouts)?


Note: It seems that Screen1 basically cannot/may not be closed.

With Xcode/Swift this should be something like this:


// Example of navigating from Screen1ViewController to Screen2ViewController
class Screen1ViewController: UIViewController {
    // Method for navigating to Screen2ViewController
    @IBAction func goToScreen2(_ sender: Any) {
        performSegue(withIdentifier: "toScreen2Segue", sender: self)
    }
}

// Example of navigating from Screen2ViewController to Screen3ViewController
class Screen2ViewController: UIViewController {
    // Method for navigating to Screen3ViewController
    @IBAction func goToScreen3(_ sender: Any) {
        performSegue(withIdentifier: "toScreen3Segue", sender: self)
    }
}

// Example of navigating from Screen3ViewController to Screen1ViewController
class Screen3ViewController: UIViewController {
    // Method for navigating to Screen1ViewController
    @IBAction func goToScreen1(_ sender: Any) {
        performSegue(withIdentifier: "toScreen1Segue", sender: self)
    }
}

We have modeled the activity stack in the Android world using iOS's UINavigationController. Using an open pushes a new instance of a screen onto the stack and a close block pops the current screen off of the stack. Screen1 is at the bottom on the stack since it is the first to open.

It sounds like what you would need to implement what you want is a block to essentially replace the current screen instance with an instance of the new screen, effectively a close + open block in the same step.

Do you have the exact blocks you are using to perform the switching? I can look at the Swift code and see if there is a way to make them work under the current system without having to implement new semantics.

Are you sure that all of these segues do not lead to memory leaks by leaving existing copies of the view controllers in memory?

Hmm, I'm not sure. But in Swift, you can use dismiss(animated:completion:) to unload a view controller or popViewController(animated:) in the case of navigation controllers.

Maybe this way:

// Example of navigating from Screen2ViewController to Screen1ViewController
class Screen2ViewController: UIViewController {
    // Method for navigating to Screen1ViewController
    @IBAction func goToScreen1(_ sender: Any) {
        dismiss(animated: true, completion: nil)
    }
}

Using these methods should ensure that view controller instances are deallocated properly, thereby avoiding memory leaks.

Screen1:

grafik

Screen2:

Note: I need the TinyDB in Screen1 (using a timer) because the Screen1.OtherScreenClosed event is not triggered with the IPA.

I have detect (only on iOS) that the Shaking Sensor Event is running always a first time when start de Screen Init app.
I have this event not available in the Design and also in the blocks screen and I d'ont shake the mobile. Attached aia example.
testINIT.aia (2.0 KB)

When I have a POST access to a external web file (.TXT) the App stop if the file has more 100 KB. It runs well only for a litle TXT files. It happens only in iOS.
I don't put an aia example to protect securty web access of my hosting.



I tried to compile one of my apps with more than 300 files in the assets (aia size < 20 MB) without success. The progress bar shows 100% but remains stuck there. I then removed more than 100 files from the assets (there were only 196 files left), but still without success. Only after I removed more files (now only 162, aia size 14.2 MB) was the app compiled.

So there seems to be a limit on the number of files in the assets. If this is true, my question is why and where is the limit? @ewpatton

Google still enforces an upper limit of 32 MB for most incoming and outgoing payloads. My guess is that the final IPA ends up being too large for the build server to return to the App Inventor server running in Google App Engine between the compiled app bundle plus all of the assets. I will have to experiment to see if that's the root cause.

1 Like

Does this also happen in the companion? I don't see anything in particular that would limit this behavior solely to compiled apps.

Yes, that could be true, this IPA with 162 files was compiled.

grafik

Hmm so yes that will definitely be a problem in the short term, at least until this goes into production and is available on the code server. I will see if I can architect a workaround in the meantime.

I haven't tried your suggestion yet:

But it should actually work. :pray:

It happens with the iOS Companion. I have detected that it not stop the App. The App is running but the answer of the GotText event is delayed for more than 5 minutes for 500 KB. The same blocks with Android and with 1000 KB have the answer with 2-3 seconds. On iOS if the txt file has <100 KB it is delayed only 2-3 seconds.

With the IPA builder file happens the same. Only for a file of 225 KB the answer of the 'GOTtext' event is more than +5 minutes.

This is the file in the Server Hosting:

When you have in the Design a Label with format='HTML' and Align='Center 'always the text of the Label is aligned to the Left (not in the Center).

You need to let in the Blocks the text of the label whith html-format "... text of the label ...". In Android is not necesary to put the code .

There are countless errors when I try to run an app compiled with AI2 for iOS. Many such errors occur when I return to Screen1 from a non-Screen1 screen by closing the current screen. For example this one:

grafik

Image13 is not on Screen1, but is on the screen "Settings".
Image13 is just a spacer between two components (Width = "Fill parent").

I'm actually very creative in finding solutions to such problems. But here I really don't know where to start. :upside_down_face: