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

Crash when using Resize #3653

Closed
ydev0927 opened this issue Jul 20, 2023 · 9 comments
Closed

Crash when using Resize #3653

ydev0927 opened this issue Jul 20, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ydev0927
Copy link

Description

Crash when using Resize

Version
SDK: com.microsoft.mixedreality.webview.unity-0.17.1-pre.3.tgz
Runtime: Unity2020.3.33
Framework: Unity2020.3.33, MRTK2.8.3
OS: (Hololens2) 22621.1120.arm64fre.ni_release_svc_sydney_rel_prod.230707-1012

Regression
Was this working before but has regressed?  >No.
If yes, what version did this last work on?

Repro Steps

  1. Clone this repository.
    https://github.com/MicrosoftEdge/WebView2Samples/
  2. Resolve compilation errors
    • Do "Restore Features" in Mixed Reality Feature Tool.
    • remove this line from package.json
      "com.unity.collab-proxy": "2.0.3",
      
  3. Open this sample in UnityEditor.
    https://github.com/MicrosoftEdge/WebView2Samples/tree/main/GettingStartedGuides/HoloLens2_GettingStarted/HoloLens2GetStartedApp
  4. Attach this script to "WebView"
using Microsoft.MixedReality.WebView;
using UnityEngine;

public class WebViewExample : MonoBehaviour
{
    private void Start()
    {
        var webViewComponent = gameObject.GetComponent<WebView>();

        webViewComponent.GetWebViewWhenReady((IWebView webView) =>
        {
            webView.Resize(webView.Width * 2, webView.Height * 2);
        });
    }
}
  1. When I run it, it crashes. (Only Hololens.)

Screenshots

Additional context

@ydev0927 ydev0927 added the bug Something isn't working label Jul 20, 2023
@novac42
Copy link
Contributor

novac42 commented Jul 20, 2023

Thanks for reaching out and seems you are running into multiple issues on WebView2 Hololens: #3654 #3652. We will take a further look into them.

@champnic
Copy link
Member

@ydev0927 Sorry you are hitting this issue. Do you have a crash dump or stack trace for when this crash happens?

Looks like the "Resize" function is part of the Unity plugin - @michaelfarnsworth

@michaelfarnsworth
Copy link
Collaborator

@ydev0927 the resizing issues should be addressed with the latest version of the plugin. Please, try version 0.17.1-pre.5 when you have a chance.

@ydev0927
Copy link
Author

@michaelfarnsworth Trying with 0.17.1-pre.5 solved the problem. thank you.

remarks
I used Unity2022.1.15.
Unity2020.3.33+0.17.1-pre.5 is a compilation error.
Unity2021.3.24+0.17.1-pre.5 is an application crash.

@ydev0927
Copy link
Author

Is there a public changelog for the com.microsoft.mixedreality.webview.unity plugin?

@novac42
Copy link
Contributor

novac42 commented Jul 24, 2023

As the issue is solved on latest Unity plugin, I will close this issue. For the public changelog redirecting to @michaelfarnsworth for answer. :)

@novac42 novac42 closed this as completed Jul 24, 2023
@ArDevKarl
Copy link

ArDevKarl commented Aug 17, 2023

As the issue is solved on latest Unity plugin, I will close this issue. For the public changelog redirecting to @michaelfarnsworth for answer. :)

It is not sovled with the current version. Using 0.17.1-pre.5. The UWP app still crashes when using IWebView.Resize(x,y) as previously described.

Tested with Unity versions: 2022.3.7f1, 2021.3.29f1

Crashes always occur when calling this:

webViewComponent.GetWebViewWhenReady((IWebView webView) => { // Do something with this.IWebView });

@michaelfarnsworth
Copy link
Collaborator

@ArDevKarl can you run the sample under the Visual Studio debugger to see what exception is being thrown?

@champnic champnic reopened this Aug 17, 2023
@ArDevKarl
Copy link

ArDevKarl commented Aug 18, 2023

As the issue is solved on latest Unity plugin, I will close this issue. For the public changelog redirecting to @michaelfarnsworth for answer. :)

It is not sovled with the current version. Using 0.17.1-pre.5. The UWP app still crashes when using IWebView.Resize(x,y) as previously described.

Tested with Unity versions: 2022.3.7f1, 2021.3.29f1

Crashes always occur when calling this:

webViewComponent.GetWebViewWhenReady((IWebView webView) => { // Do something with this.IWebView });

I need to correct myselft here. Just found out, that Resize is not the cause of the crash. The problem is, that the application crashes, when I try to instantiate a WebView as a child and/or with localScale zero. I'll open another threat for this issue. Resize works as intended.

#3721

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

7 participants