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

Fix ios crash #84

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Fix ios crash #84

merged 1 commit into from
Apr 10, 2024

Conversation

extrawurst
Copy link
Contributor

fixes #83

@amodm
Copy link
Owner

amodm commented Apr 10, 2024

Thanks @extrawurst. Can you please also share what kind of URL was breaking this?

@amodm amodm merged commit 0d54886 into amodm:main Apr 10, 2024
10 checks passed
@amodm
Copy link
Owner

amodm commented Apr 10, 2024

This is good to go, but I'll wait to hear about the URL that caused this issue, so that I can modify the tests for it accordingly. The patch release will happen after that.

@extrawurst
Copy link
Contributor Author

I tried https://github.com and a custom discord invite link. may impression was that it never worked in sim and only due to good luck on the first invocation on device

@extrawurst
Copy link
Contributor Author

you can test this with the bevy_game_template using webbrowser on iOS Simulator, see the offending URL in there: https://github.com/NiklasEi/bevy_game_template/blob/dcbc44bdc97793040cf5af746d0cbf8b2907dd81/src/menu.rs#L117

@amodm
Copy link
Owner

amodm commented Apr 10, 2024

There are tests that run every time on the sim for iOS (you can check yourself by having a sim on, and running cargo test --test test_ios -- --include-ignored. I've run a test just now by modifying tests/test-ios-app/testglue/src/lib.rs to include the following:

let _ = webbrowser::open("https://bevyengine.org");

and it ran just fine in the sim (opened that url). Initially I'd thought it's some url with weird characters. Have you verified that this change fixes the issue on your machine?

@extrawurst
Copy link
Contributor Author

Have you verified that this change fixes the issue on your machine?

yes on sim and device

@amodm
Copy link
Owner

amodm commented Apr 10, 2024

Cool. This is now released as v0.8.15. Thanks for your contribution.

@extrawurst
Copy link
Contributor Author

@amodm thanks! I tried to run your tests but could not, but I am intrigued as I am working on objc2 ios bindings more often: https://github.com/rustunit/bevy_ios_impact

on running cargo test --test test_ios -- --include-ignored I get:

...
Build description path: /Users/stephan/code/webbrowser-rs/tests/test-ios-app/build/Build/Intermediates.noindex/XCBuildData/f30b078df2026582be4674985ebd6d53.xcbuilddata
/Users/stephan/code/webbrowser-rs/tests/test-ios-app/test-ios-app.xcodeproj: error: Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the currently selected device "<My PC>" (identifier <My-UUID>). (in target 'test-ios-app' from project 'test-ios-app')
** BUILD FAILED **

@amodm
Copy link
Owner

amodm commented Apr 10, 2024

@extrawurst, seems to be an issue with the provisioning profile. You may need to open tests/test-ios-app/test-ios-app.xcodeproj and check on the xcode configuration. Sometimes Xcode behaves erratically until you "touch" the provisioning profile.

Here's a rundown of the test architecture:

  • For ios testing, the "app" being built is tests/test-ios-app/test-ios-app
  • This uses a rust lib called testglue which is under tests/test-ios-app/testglue. This is the lib that calls webbrowser::open
  • tests/test_ios.rs invokes cargo build for testglue, and xcode to build the test-ios-app, and then runs it on the sim

If debugging feels too much work, and you suspect objc2 is the issue, just log another bug with some reproduction hints, and I'll take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash on iOS and iOS-Sim
2 participants