ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.85k stars 69 forks source link

iOS example crash on real hardware with error "-[RSTView animator]: unrecognized selector sent to instance" #32

Closed marysaka closed 2 years ago

marysaka commented 2 years ago

This was tested against a790eb95b77900ef52d25e1211166787be3bc23a with the example on the repo

It appears to me that RSTView is registered in multiple places of the codebase, those could possibly conflict I suppose?

Cargo.toml:

cacao = { git = "https://github.com/ryanmcgrath/cacao", features = [ "uikit", "autolayout" ], default-features = false }

Device syslog for the process:

Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Initializing connection
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Removing all cached process handles
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Sending handshake request attempt #1 to server
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: Deactivation reason added: 10; deactivation reasons: 0 -> 1024; animating application lifecycle event: 0
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Creating connection to com.apple.runningboard
Jul 14 11:23:48 testing_ios_rust(libMobileGestalt.dylib)[43732] <Notice>: Cache loaded with 4896 pre-cached in CacheData and 52 items in CacheExtra.
Jul 14 11:23:48 testing_ios_rust(BoardServices)[43732] <Notice>: activating monitor for service com.apple.frontboard.open
Jul 14 11:23:48 testing_ios_rust(BoardServices)[43732] <Notice>: activating monitor for service com.apple.frontboard.workspace-service
Jul 14 11:23:48 testing_ios_rust(FrontBoardServices)[43732] <Notice>: FBSWorkspace connecting to endpoint : <private>
Jul 14 11:23:48 testing_ios_rust(FrontBoardServices)[43732] <Notice>: FBSWorkspace registering source: <private>
Jul 14 11:23:48 testing_ios_rust(FrontBoardServices)[43732] <Notice>: FBSWorkspace connected to endpoint : <private>
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Added observer for process assertions expiration warning: <_RBSExpirationWarningClient: 0x28042d4c0>
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Handshake succeeded
Jul 14 11:23:48 testing_ios_rust(RunningBoardServices)[43732] <Notice>: Identity resolved as application<zone.mary.testing.testing-ios-rust>
Jul 14 11:23:48 testing_ios_rust(libAccessibility.dylib)[43732] <Notice>: Read CategoryName: per-app = 1, category name = (null)
Jul 14 11:23:48 testing_ios_rust(libAccessibility.dylib)[43732] <Notice>: Read CategoryName: per-app = 0, category name = (null)
Jul 14 11:23:48 testing_ios_rust(XCTTargetBootstrap)[43732] <Notice>: Registering for test daemon availability notify post.
Jul 14 11:23:48 testing_ios_rust(XCTTargetBootstrap)[43732] <Notice>: notify_get_state check indicated test daemon not ready.
Jul 14 11:23:48 testing_ios_rust(XCTTargetBootstrap)[43732] <Notice>: notify_get_state check indicated test daemon not ready.
Jul 14 11:23:48 testing_ios_rust(XCTTargetBootstrap)[43732] <Notice>: notify_get_state check indicated test daemon not ready.
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: Deactivation reason added: 11; deactivation reasons: 1024 -> 3072; animating application lifecycle event: 0
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: Deactivation reason removed: 10; deactivation reasons: 3072 -> 2048; animating application lifecycle event: 0
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: <private>: Will add backgroundTask with taskName: <private>, expirationHandler: <__NSGlobalBlock__: 0x2089178f0>
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: <private>: Created background task <private>. Assertion will be assigned soon
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: <private>: Creating new assertion since assertion is nil
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: <private>: Created new assertion <BKSProcessAssertion: 0x282721ae0>
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: Deactivation reason added: 5; deactivation reasons: 2048 -> 2080; animating application lifecycle event: 1 
Jul 14 11:23:48 testing_ios_rust(UIKitCore)[43732] <Notice>: [0x282f30000] Initialized with scene: <UIWindowScene: 0x13ff04be0>; behavior: <_UIEventDeferringBehavior_Default: 0x28042bc20>
Jul 14 11:23:48 testing_ios_rust(CoreFoundation)[43732] <Notice>: -[RSTView animator]: unrecognized selector sent to instance 0x141d05510
Jul 14 11:23:48 testing_ios_rust(CoreFoundation)[43732] <Notice>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RSTView animator]: unrecognized selector sent to instance 0x141d05510'
*** First throw call stack:
(0x1ad679288 0x1c6373744 0x1ad756fc4 0x1b09cdf5c 0x1ad60de98 0x1ad60cf70 0x1000e71f0 0x1000e57d4 0x1000f0f40 0x1000e9ba4 0x1000e94e4 0x1000e939c 0x1000d6788 0x1000d63e8 0x1000d5484 0x1afdaf390 0x1b00aec64 0x1afdb1a48 0x1afcf2508 0x1bf883294 0x1bf8a9090 0x1bf864308 0x1bf865958 0x1ad2e0a30 0x1ad2e44e0 0x1bf865c70 0x1bf865040 0x1bf869700 0x1ad69b414 0x1ad6ac1a0 0x1ad5e56f8 0x1ad5eb05c 0x1ad5febc8 0x1c9732374 0x1aff6e648 0x1afcefd90 0x1000ddaa8 0x1000d6724 0x1000d99f4 0x1000e0414 0x1000d5ca0 0x10012c9dc 0x1000d5c68 0x1000d68e4 0x10063dce4)
ryanmcgrath commented 2 years ago

Ah, yeah, this is an oversight on my part - and why I label iOS as alpha, heh. More people testing it will push things like this to get found and fixed though, so def appreciate this issue being opened.

The core issue is that the APIs used for animation in Cocoa are here, and I simply didn't do the iOS counterpart - it's attempting to initialize animator proxy access with a selector that's not used on iOS.

I'd need to sit down and either stub this out so it's just a no-op on iOS for now, or do the actual work to support basic animations on iOS as well.

ryanmcgrath commented 2 years ago

46 should fix this one it's merged - so closing this for now. Any further comments can go over there.

Thanks for reporting it!

Miha-Rozina commented 1 year ago

Is this supposed to be fixed in 0.3.2? I get the same error. If not, is there a plan on releasing a new version with this fix?

ryanmcgrath commented 1 year ago

I thought I fixed this, but it probably isn’t on crates.io - try the repo code tho.

On Thu, Jun 8, 2023 at 03:30, Miha @.***(mailto:On Thu, Jun 8, 2023 at 03:30, Miha < wrote:

Is this supposed to be fixed in 0.3.2? I get the same error. If not, is there a plan on releasing an new version with this fix?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

Miha-Rozina commented 1 year ago

With the repo code it works with the commit 64908e5. I think I tried the latest commit a few days ago and it also didn't work, but another issue.

I'm trying to publish my crate and with published crates you cannot have git dependencies. Thats why I am asking if its possible to get a new version on crates.io.

ryanmcgrath commented 1 year ago

Ah, sure - I can cut a release tomorrow. Ping me if I don’t get to it.

On Thu, Jun 8, 2023 at 03:41, Miha @.***(mailto:On Thu, Jun 8, 2023 at 03:41, Miha < wrote:

With the repo code it works with the commit 64908e5. I think I tried the latest commit a few days ago and it also didn't work, but another issue.

I'm trying to publish my crate and with published crated you cannot have git dependencies. Thats why I am asking if its possible to get a new version on crates.io.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

Miha-Rozina commented 1 year ago

Alright, thanks a lot!

ryanmcgrath commented 1 year ago

@Miha-Rozina there should be a 0.4.0-beta1 on crates.io now. I opted to cut a beta release for the moment since there's some more internal changes lurking and I want to communicate to people that it may be wonky at first, but this should hopefully still unblock you for now. Let me know how it works, thanks!

Miha-Rozina commented 1 year ago

Thanks a lot! I do get a runtime error though, but a different one. I'll open a new issue about it.