Closed ffarall closed 3 years ago
I'm getting this exact same issue on my Samsung Galaxy A50. With a new project with just AR Session and AR Session Origin, it crashes as soon as I press the "Allow Camera" option.
The arfoundation-samples project worked a few days ago on my phone, but I re-ran it today and it crashed as well. On a hunch I looked at my app updates, and Google Play Services for AR
(a.k.a. ARCore) was updated yesterday. This makes me think something changed with ARCore which is causing this issue.
When I run adb shell pm dump com.google.ar.core | findstr /i "packages: versionName"
to get the version, I get:
Packages:
versionName=1.19.202100503
Hidden system packages:
versionName=0
Active APEX packages:
Inactive APEX packages:
Factory APEX packages:
@Cimera42 your comment was remarkably useful! I thought the problem was with my phone but in fact is a problem with the Google Play Services for AR update, like you guessed. I managed to install an older version of the app following the instructions here and the app started working again (without having to build it again or anything, I just ran it an it worked perfectly like before). I hope the people at Google notice this issue because it's quiet important.
I found a solution after seeing the warning on the landing page of this repo, which says:
Upcoming breaking change affecting previously published 32-bit-only apps In August 2020, Google Play Services for AR (ARCore) will remove support for 32-bit-only ARCore-enabled apps running on 64-bit devices. Support for 32-bit apps running on 32-bit devices is unaffected. ... 32-bit-only ARCore-enabled apps that are not updated by this time may crash when attempting to start an augmented reality (AR) session.
To enable 64-bit build for Android in Unity, I did the following:
IL2CPP
(required for ARM64)ARM64
under Target Architectures
Seems ridiculous that there is no warning or verbose error message anywhere, but exporting a new build from Unity now works on my phone.
Also do you mean August, not April in the new issue title?
I was just looking into that same thing and it worked for me too with the latest Google Play Services for AR. I share your opinion that there should be a stronger warning.
PS: Thanks for noticing the August mistake.
@ffarall Did @Cimera42's solution work for you?
@aymusbond yes, both solutions worked, going to a previous version of Google Play Services for AR as well as building for ARM64. Here's also a stackoverflow question on how to do it. I'd recommend doing the second solution since it's what Google wants and if you publish your app you won't be having problems with users using a 64 bit architecture.
@ffarall Thanks for the reply. The ARM64 solution worked even for me now 😁. I was really worried about why's this happening.
Apologies for the confusion!
TLDR: The dev docs will make this more clear (in progress).
Context: We are in the middle of rolling out ARCore 1.19.0. This means that you may be using Google Play Services for AR v1.19.x (which removes support for 32-bit-only ARCore-enabled apps running on 64-bit devices), but the updated instructions for using the SDK on a 64-bit device are not yet posted on the dev guides. The solution mentioned above (also here) is precisely what you will want to do in that scenario.
Solution: If building for ARCore 1.19.0 or higher and supporting 64-bit devices:
Build Settings
> Player Settings
> Other Settings
Scripting Configuration
to IL2CPP
(from Mono
).ARM64
under Target Architectures
.Leaving this open until the docs clearly mention this. Thanks for the reports and attention to this issue everyone!
The settings required to build to a 64-bit device are now documented in the Unity SDK Quickstart for Android.
Additionally, in the next SDK release, the Unity console should log a warning when the ARM64
architecture is not selected on Android.
SPECIFIC ISSUE ENCOUNTERED
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:
I've managed to find the C# script containing the
UnityARCore_session_update
function, and I checked that none of its four arguments arenull
. From what I could understand, after that, the script calls a function defined in UnityARCore dll, so I couldn't go any further.I made an empty project with just an AR Session Origin and an AR Session, and I checked if it would work, but it also crashes.
I would like to remark the fact that this happened from one day to another, everything had been working perfectly on my phone for months. One day I built the app and it was ok, the other day I opened it again (no new builds or phone updates in the middle), and from there on, always crashing.
Also, I want to clarify that the Huawei phone I´m using is from Australia, I´m using it from Argentina, and it has nothing to do with the Chinese versions. It runs on Android 10 and has Google Play Services (in fact Play Services for AR are installed).
VERSIONS USED
adb shell pm dump com.google.ar.core | findstr /i "packages: versionName"
On macOS, use:adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:
adb shell getprop ro.build.fingerprint
:STEPS TO REPRODUCE THE ISSUE
WORKAROUNDS (IF ANY)
Locate the file
ARCoreSessionSubsystem
insidePackages/com.unity.xr.arcore/Runtime/
and comment out lines 95 to 99, which is the function call forNativeApi.UnityARCore_session_update
.The app won't crash but the camera won't show either, so it's not really a full workaround.