viromedia/viro

virocore crashes on android api 30 (android 11)

anahitaBarzegar opened this issue · 2 comments

I've recently used virocore for augmented reality app and run the sample application on android api30, but unfortunately it crashes on emulator android api 30.
also in real device with android api 30 show me installing google arcore from playstore (however last version of google arcore had been installed).
fortunately it run as charm on android api 29.
the error in api level 30 in emulator is belong to gvr, gvr_audio and viro_core library defined in ViroViewARcore classes.
I used the last version of virocore-release-v_1_17_0.aar, gvr-1_200_1.aar, and arcore_client-v_1_22_0.aar in the application.
does the library have any update for android api 30?
please help me to solve this problem

Que sad, me pasa lo mismo y venia aca pensando en que podria solucionarlo, pero naranjas

I was also having this issue, it seems that devices with Android 11 and API 30 are prompted to download Google Play Services for AR even if Google Play Services for AR is installed. As a result, the AR Scene did not load. My app worked fine on devices below API 30.

When I build to targetSdkVersion 29 instead of 30 the app runs fine on devices with API 30, as seen below. The only issue is at this time the Google Play Store will only accept targetSdkVersion of 30, so we needed another solution.

android/build.gradle:

ext {
  ...
  minSdkVersion = 21
  compileSdkVersion = 30
  targetSdkVersion = 29
  ...
}

The solution I went within in the end was adding the following to our android manifest. Not 100% sure how it works but it fixed the issue when building to SDK 30 for us.

android/app/src/mail/androidManifest.xml:

<manifest>
  ...
  <queries>
    <package android:name="com.google.ar.core" />
  </queries>
  ...
</manifest>

This solution was taken from the following Stack Overflow thread:
https://stackoverflow.com/a/68365747

Best of luck with your solving issues!