Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS app not showing content with Rubicon ObjC 0.4.4 #1750

Closed
freakboy3742 opened this issue Jan 24, 2023 · 2 comments · Fixed by #1751
Closed

iOS app not showing content with Rubicon ObjC 0.4.4 #1750

freakboy3742 opened this issue Jan 24, 2023 · 2 comments · Fixed by #1751
Labels
bug A crash or error in behavior.

Comments

@freakboy3742
Copy link
Member

freakboy3742 commented Jan 24, 2023

Describe the bug

When running an iOS app with Toga 0.3.0dev39 and Rubicon 0.4.4, the app isn't successfully started, and the main app content is never displayed. When the app runs, you'll see the following in the log:

2023-01-24 12:14:13.871494+0800 Hello World[94057:4239245] Running app module: helloworld
2023-01-24 12:14:14.399629+0800 Hello World[94057:4239245] /Users/rkm/Library/Developer/CoreSimulator/Devices/84FC86CA-1D89-46EF-9349-29DDCF840143/data/Containers/Bundle/Application/7038F3CE-2212-4C60-9067-1978A80DEC8D/Hello World.app/app_packages/toga_iOS/app.py:95: DeprecationWarning: There is no current event loop
2023-01-24 12:14:14.399738+0800 Hello World[94057:4239245]   self.loop = asyncio.get_event_loop()

This is a warning, not an error; the app will continue to run.

Steps to reproduce

  1. Run examples/tutorial0 on iOS
  2. See error

The app won't crash; but the app window will remain black.

Expected behavior

The app should run and window content should be displayed.

Screenshots

No response

Environment

  • Operating System: iOS
  • Python version: All
  • Software versions:
    • Briefcase: All
    • Toga: <=0.3.0.dev39
    • Rubicon-objc 0.4.4

Logs

N/A

Additional context

The error has been caused because Toga-iOS 0.3.0.dev39 included a shim that reproduced the implementation of run_forever_cooperatively(). This was done when the iOS implementation was originally created, with the expectation that this shim would be replaced with the actual call once Rubicon 0.3 was released. This didn't happen, but the old shim continued to work as it matched the implementation in Rubicon.

However, Rubicon 0.4.4 altered the implementation of run_forever_cooperatively(). As a result, the shim in Toga-iOS 0.3.0.dev39 no longer does everything it needs to in order to start the app.

The issue has already been fixed in the main branch - the shim has been replaced with the actual call to run_forever_cooperatively().

Two workarounds exist:

  1. Use the main branch of Toga in your app.
  2. Block the use of rubicon-objc 0.4.4. If you add rubicon-objc!=0.4.4 to the requires list in your iOS configuration, this will prevent toga-iOS from using the new version.
@freakboy3742 freakboy3742 added the bug A crash or error in behavior. label Jan 24, 2023
@mhsmith
Copy link
Member

mhsmith commented Jan 24, 2023

If this breaks all existing iOS apps, I think it's serious enough to justify yanking Rubicon 0.4.4 until we're ready to release Toga 0.3.0 final.

And to make it easier to deal with similar situations in future, we could release Toga 0.3.0 with a requirement on Rubicon ~= 0.4.4. That way, any future incompatible releases of Rubicon can be released as 0.5.x, without breaking any existing apps which are still on Toga 0.3.0.

@freakboy3742
Copy link
Member Author

Yeah... it's annoying, but I think you're right.

So - I've just yanked the Rubicon 0.4.4 release, which will resolve this issue for normal "pip install" usage of Toga and Rubicon. This will cause CI failures for the current mainline, as there now isn't a version of Rubicon that matches the ">=0.4.4" specifier being used by toga-cocoa and toga-iOS.

I'll release a rubicon-objc 0.4.5rc1 tomorrow, and update Toga to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants