- Home /
App crashes after splash screen with Google Play Services for AR update (after April 11th 2020)
I'm working collaboratively on an Android app that uses AR Foundation. From one day to another (without making new builds) the app started to crash after the splash screen, every time. I'm working on my Huawei Mate 20 Pro, but my teammates use other Android phones (Samsung, Xiaomi and Motorola) and they continued to develop the app, and it works just fine for them. I pull their commits (which work for them), make no changes, and it keeps crashing on my phone. We are using Firebase so I have the info from Crashlytics, but I can't quiet understand it:
Answer by facundofarall · Aug 14, 2020 at 05:19 PM
I updated the question's title because the problem is caused by an issue in the update of Google Play Services for AR. I managed to make my app work by manually downloading an older version of Google Play Services for AR, following the instructions here. You can track the issue I opened in the ARCore Unity SDK repo here
Answer by GoldenretriverYT · Aug 13, 2020 at 08:59 PM
This might be a unity bug. Issue tracker
Indeed I've managed to narrow down the crash to the following lines of code, inside the Update of ARSession script:
void Update()
{
if (subsystem?.running == true)
{
m_Tracking$$anonymous$$ode = subsystem.requestedTracking$$anonymous$$ode.ToTracking$$anonymous$$ode();
if (subsystem.matchFrameRateEnabled)
{
Application.targetFrameRate = subsystem.frameRate;
QualitySettings.vSyncCount = 0;
}
//subsystem.Update(new XRSessionUpdateParams
//{
// screenOrientation = Screen.orientation,
// screenDimensions = new Vector2Int(Screen.width, Screen.height)
//});
switch (subsystem.trackingState)
{
case TrackingState.None:
case TrackingState.Limited:
state = ARSessionState.SessionInitializing;
break;
case TrackingState.Tracking:
state = ARSessionState.SessionTracking;
break;
}
}
}
With those commented lines, the app starts but the camera won't work. If I uncomment them, it crashes. I know the problem is there because I placed a:
UnityEngine.Handheld.Vibrate();
Before and after, and the phone only vibrates once.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
display www.texture from url causes crash in some devices 0 Answers
Game crashes after sleep mode in Android 0 Answers
Random android crashes 1 Answer
C# and JavaScript Unstable? 1 Answer