flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

Vuforia init error

Open davidGM-00 opened this issue 4 years ago • 10 comments

Hi, I'm working in a flutter + Unity + Vuforia app and when I install the app in my device the unity scene works, but if I come back with the android button the app crash and when I open the app again and I can't start the unity scene because Vuforia can't init, "Vuforia Engine Initialization Error", "Init Error"

davidGM-00 avatar May 28 '20 15:05 davidGM-00

Hi there, I had the same error, I could fix it by setting Delayed Initialization in Vuforia setting Screenshot 2020-06-06 at 15 54 34

and add a script to the camera to initialize it after some delay (for me it works when I put 3 seconds delay)

using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia;

public class VuforiaInit : MonoBehaviour { public Camera ARCamera; int index = 0; private float timeLeft = 0.0f;

void Update()
{
    timeLeft+=Time.deltaTime;
    if (timeLeft>=3.0)
    {
        VuforiaRuntime.Instance.InitVuforia();
        ARCamera.GetComponent<VuforiaBehaviour>().enabled = true;
        print(timeLeft.ToString());
    }
}

}

tarekBelk avatar Jun 06 '20 15:06 tarekBelk

Hello, I'm facing the same problem too here

While i play and build the unity app in the unity, it works fine

But after i export it to my flutter project, when i press the button from my app to open the unity scene, it says : Screenshot_20200618-012550

I tried your delay solution, but not work Any suggestions?

Regards, Slim

slimmziy avatar Jun 18 '20 04:06 slimmziy

@davidGM-00 we have not tried against Vuforia sadly

juicycleff avatar Nov 21 '20 21:11 juicycleff

The v2 if the widget works like a charm

slimmziy avatar Nov 21 '20 23:11 slimmziy

@juicycleff With the latest release 3.0.1, Vuforia works!

However steps are bit different, check https://github.com/juicycleff/flutter-unity-view-widget/issues/158#issuecomment-739146983

I will document a step by step guide shortly,

Many thanks for this wonderful plugin

With Gratitude

planetMatrix avatar Dec 05 '20 08:12 planetMatrix

Where do I add the script ? @tarekBell

parasshakya avatar Dec 16 '20 07:12 parasshakya

@parasshakya attach the script to the camera

tarekBelk avatar Dec 16 '20 13:12 tarekBelk

Thanks @tarekBelk . It solved the problem for me.

parasshakya avatar Dec 16 '20 17:12 parasshakya

Thanks, @tarekBelk! This worked for me!

0xhrsh avatar Apr 16 '21 19:04 0xhrsh

@parasshakya attach the script to the camera @tarekBelk what do you mean by this?? which script?

dmgcoding avatar Feb 07 '22 16:02 dmgcoding