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

Trying to click on the AR preview button in iOS results in error #8

Closed
stijnie2210 opened this issue Feb 23, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@stijnie2210
Copy link

Describe the bug
on iOS (with a usdz file) the model loads, but when i click on the AR button the following error occurs in the terminal:

flutter: >>>> ModelViewer failed to load: Error Domain=WebKitErrorDomain Code=102 "Frame load interrupted" UserInfo={_WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x6000031747c0>, NSErrorFailingURLStringKey=https://raw.githubusercontent.com/kcoley/usdz_test_models/dev/Output/BoomBox/BoomBox.usdz, NSErrorFailingURLKey=https://raw.githubusercontent.com/kcoley/usdz_test_models/dev/Output/BoomBox/BoomBox.usdz, NSLocalizedDescription=Frame load interrupted} (null 102)

To reproduce
on iOS 15.3, load any usdz file into the ModelViewer widget and click on the AR button. Could be checked out via the example project.

Smartphone (please complete the following information):

Device: iPhone 12 pro max
OS: iOS 15.3.1
Version: 1.1.2

@stijnie2210 stijnie2210 added the bug Something isn't working label Feb 23, 2022
@omchiii
Copy link
Owner

omchiii commented Feb 27, 2022

Could you please record? ARView should be only available for android devices, even the button should not appear.

@stijnie2210
Copy link
Author

@omchiii That doesn't seem entirely logical. In the documentation it says iosSrc is meant to be able to contain a path to a usdz file while should be opened in AR QuickLook. If it's not supposed to do that I don't see why it would contain the iosSrc path. You're correct that it doesn't show the button if you don't add anything to the iosSrc, but as soon as you do the button appears.

RPReplay_Final1646039656.MP4

Anyway, I've attached my screenrecording:
You can see the model is displayed fine, but tapping on the button does nothing except that the button border becomes blue and it prints an error in the terminal.

@omchiii
Copy link
Owner

omchiii commented Mar 1, 2022

Thank you. You are right. Will have a look into it.

Foldblade added a commit to Foldblade/model_viewer_plus.dart that referenced this issue Mar 15, 2022
Foldblade added a commit to Foldblade/model_viewer_plus.dart that referenced this issue Mar 15, 2022
@Foldblade
Copy link
Collaborator

This package use WebView for the display of model-viewer on Android & iOS. On iOS Platform, after you click on the AR preview button, model-viewer will redirect the browser to the usdz file's url. According to react-native-webview/react-native-webview#1242 (comment) , to open usdz model in AR Quick Look, iOS WebView should be SFSafariViewController instead of WKWebView.

This package uses webview_flutter which is backed by a WKWebView, so I think that's the problem.

I have no experience on iOS development. A less elegant solution I made in 7974cd6 is: using url_launcher to open the usdz file in SFSafariViewController, and then you can open it in AR Quick Look.

Simulator Screen Shot - iPhone 13 Pro - 2022-03-15 at 16 43 32

Hoping there can be a more elegant solution.

omchiii added a commit that referenced this issue Mar 17, 2022
Fix #11 and a less elegant solution of #8
@omchiii omchiii closed this as completed Mar 17, 2022
@omchiii
Copy link
Owner

omchiii commented Feb 25, 2023

#50 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants