Hello,
Summarize the bug:
Using Vuforia on Unity, calling VuforiaApplication.Instance.Deinit() will make the application freeze if the device is connected to a network that has no access to the internet or is blocking "usageservice.prod.vuforia.com".
On a Android build, the application is frozen indefinitely.
On the Unity Editor, the whole Editor is frozen for about 30-60 seconds then resumes normally.
Observed problem
Our devices are connected to a restricted network that only allows whitelisted URLs.
When calling VuforiaApplication.Instance.Deinit() on an Android build, we can see the following logs in the Android logcat :
Stopping Vuforia Engine instance...SUCCESS
Vuforia Stopped
Image output formats can only be changed after Vuforia is started
Deactivating observer...
Deactivated observer with ID '1'
Deactivating observer...SUCCESS
Destroying observer...
Destroyed observer with ID '1'
Destroying observer...SUCCESS
Destroying observer...
Destroyed observer with ID '2'
Destroying observer...SUCCESS
Destroying observer...
Destroyed observer with ID '3'
Destroying observer...SUCCESS
Destroying Vuforia Engine instance...
I0000 00:00:1750858617.971002 19523 session_lite_c_api.cc:37] Deleting ArSession...
I0000 00:00:1750858617.980503 20353 jni_util.cc:91] Exiting thread. Detach thread.
W0000 00:00:1750858617.982629 19523 vio_estimator.cc:810] [VioEstimator] Number of VIO filter resets: 1
W0000 00:00:1750858617.984677 19523 statistics.cc:265] Reset statistics may cause dangling handle issue
I0000 00:00:1750858617.984714 19523 session_lite_c_api.cc:39] Deleted ArSession.
But it stops there and the application is completely frozen.
If I switch the device to a different network that has access to the internet, the application immediately resumes and we can see these logs in the Android logcat:
java.net.ConnectException: Failed to connect to usageservice.prod.vuforia.com/34.213.65.178:443
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:147)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
Exception message Failed to connect to usageservice.prod.vuforia.com/34.213.65.178:443
Some other error occurred while attempting to connect! Reporting OTHER_ERROR, see System.err log for more details.
java.net.ConnectException: Failed to connect to usageservice.prod.vuforia.com/34.213.65.178:443
[...]
Exception message Failed to connect to usageservice.prod.vuforia.com/34.213.65.178:443
Some other error occurred while attempting to connect! Reporting OTHER_ERROR, see System.err log for more details.
Which finally let Vuforia deinitialize:
Destroying Vuforia Engine instance...SUCCESS
Vuforia Deinitialized
We are forced to use Deinit() because we want to switch between the normal classic Vuforia Camera input and a FileDriver (https://developer.vuforia.com/library/vuforia-engine/platform-support/camera/driver-framework/building-and-using-file-driver-sample/), so we must call Deinit() before VuforiaApplication.Instance.Initialize(driverName, userData).
Our application do not use any feature that should require access to the internet.
Expected result
Vuforia deinitializes without blocking the application forever.
Other observations
The bug does not happen if the device is not connected to any network, only if it is connected to a network that has no access to the internet or is blocking "usageservice.prod.vuforia.com".
This is the call that is making the application hang (using breakpoints in the Unity Editor).
VuforiaApplication.Deinit() => CoreDependencies.Instance.Engine.Deinit(); --> this.mEngine.Dispose(); --> int num = (int) VuEngine.vuEngineDestroy(this.mNativeHandle); --> Application freezes.
Reproducible steps
Steps to reproduce the behavior:
- Build an Android app with Unity
- Initialize Vuforia (auto initialization or delayed)
- Connect your device to a network that has no access to the internet or is blocking "usageservice.prod.vuforia.com". (the bug does not happen if the device is not connected to any network).
- Call
VuforiaApplication.Instance.Deinit().
- Application freezes forever.
Affected Vuforia Engine version:
10.29.6
Affected platform:
- Workstation OS: Windows
- Platform: Unity
- Platform version: 2022.3.54f1
Affected device:
Multiple difference Android devices were tested on different Android version from 13 to 15.
Also affects Unity Editor (Editor freezes for 30-60 seconds but not forever).
Screenshots / Video Recordings
May provide on further request.
Affected database
N/A
Device or platform logs
Shared above in the problem description.
Workaround
No workaround was found.
Additional comments
PLEASE, we would appreciate any workaround or help to get past this issue. It is blocking a major feature.
Hello,
Summarize the bug:
Using Vuforia on Unity, calling
VuforiaApplication.Instance.Deinit()will make the application freeze if the device is connected to a network that has no access to the internet or is blocking "usageservice.prod.vuforia.com".On a Android build, the application is frozen indefinitely.
On the Unity Editor, the whole Editor is frozen for about 30-60 seconds then resumes normally.
Observed problem
Our devices are connected to a restricted network that only allows whitelisted URLs.
When calling
VuforiaApplication.Instance.Deinit()on an Android build, we can see the following logs in the Android logcat :But it stops there and the application is completely frozen.
If I switch the device to a different network that has access to the internet, the application immediately resumes and we can see these logs in the Android logcat:
Which finally let Vuforia deinitialize:
We are forced to use
Deinit()because we want to switch between the normal classic Vuforia Camera input and a FileDriver (https://developer.vuforia.com/library/vuforia-engine/platform-support/camera/driver-framework/building-and-using-file-driver-sample/), so we must callDeinit()beforeVuforiaApplication.Instance.Initialize(driverName, userData).Our application do not use any feature that should require access to the internet.
Expected result
Vuforia deinitializes without blocking the application forever.
Other observations
The bug does not happen if the device is not connected to any network, only if it is connected to a network that has no access to the internet or is blocking "usageservice.prod.vuforia.com".
This is the call that is making the application hang (using breakpoints in the Unity Editor).
VuforiaApplication.Deinit() => CoreDependencies.Instance.Engine.Deinit();-->this.mEngine.Dispose();-->int num = (int) VuEngine.vuEngineDestroy(this.mNativeHandle);--> Application freezes.Reproducible steps
Steps to reproduce the behavior:
VuforiaApplication.Instance.Deinit().Affected Vuforia Engine version:
10.29.6
Affected platform:
Affected device:
Multiple difference Android devices were tested on different Android version from 13 to 15.
Also affects Unity Editor (Editor freezes for 30-60 seconds but not forever).
Screenshots / Video Recordings
May provide on further request.
Affected database
N/A
Device or platform logs
Shared above in the problem description.
Workaround
No workaround was found.
Additional comments
PLEASE, we would appreciate any workaround or help to get past this issue. It is blocking a major feature.