ReactVision / viro

ViroReact: The AR and VR library for React Native πŸ“³πŸ’™πŸ’›πŸ€πŸ’š

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash problem for react-native version 0.71.x

ardasnturk opened this issue Β· comments

Requirements:

Environment

  1. Development OS: Mac
  2. Device OS & Version:
    • Android OS version: 13.0
    • iOS version: 16.x
  3. Version:
    • ViroReact version: 2.23.0
    • React Native version : 0.71.8
  4. Device(s):
    • Google Pixel 4 XL
    • iPhone 7
    • iPhone 13 Pro Max

Description

Because of react-native and react updated with Expo 48, we lost viro support in the application. I am looking for new methods to get viro working again. Please help me with this.

When the application was in Expo 45 version, we integrated Viro and managed to run it without any problems.

Since Expo stopped supporting version 45, we updated to version 48. With this update, react-native and react were also updated. That's why the application started to crash when I opened the screens using Viro.

I tried different methods but none of them was a perfect solution.

I posted a post on Viro's Discord channel stating that I had the same problem. You can access my post from this link to respond faster.

The application does not show any log for the crash problem. That's why I can't share it here.

I was only able to reach this error on Android.

image

package.json:

"react-native": "0.71.8",
"react": "18.2.0",
"@viro-community/react-viro": "^2.23.0",
"expo": "~48.0.18",

Problem solved. Viro doesn't officially support react-native version 0.71.x, but I can say that it works.

Solution for Android:

  1. first add jcenter() to repositories in android/build.gradle.
  2. add the following code to the dependencies section in android/app/build.gradle
    implementation project(':gvr_common')
    implementation project(':arcore_client')
    implementation project(path: ':react_viro')
    implementation project(path: ':viro_renderer')
    implementation 'com.google.android.exoplayer:exoplayer:2.17.1'
    implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'

If you are using expo, you can create a production build with npx expo run:android -d --variant Release.