viro icon indicating copy to clipboard operation
viro copied to clipboard

React navigation makes the app crash when going back from ViroARSceneNavigator

Open anxheloo opened this issue 6 months ago โ€ข 11 comments

I have a Main navigator with multiple screens where one of them is ViroARSceneNavigator that has an ViroARScene with ViroArImageMarker that displayes a Video on top of the image when recognized.

When i go back from this scene to the previous screen app closes immidietly. Also some methods like onAnchorRemoved doesnt work.

I was using react native 0.76 before because this library was not working with latest version but after forking the library and made some changes it is working on latest react native now. Still the app crashes. Is there any solution or advice ? Thanks in advance!

anxheloo avatar Jun 13 '25 21:06 anxheloo

Hi @anxheloo,

We're currently testing version 2.43.1 with the community, and this update should resolve this issue.

If you'd like to join our beta program and test 2.43.1 to ensure this issue is resolved ahead of release then you can do so here: https://discord.gg/6fAu7kFr

oliedis avatar Jun 16 '25 15:06 oliedis

+1 Facing this issue

I am adding a simple ViroARSceneNavigator and ViroARScene to a modal.

When I close the modal, the app crashes. Will follow this issue and the 2.43.1 testing for updates.

malika-k avatar Jun 16 '25 17:06 malika-k

Hi @oliedis ,

Does this beta version supports react native latest version?

Till now i forked the current available update and changed some files in order to use it with react 19 and react native 0.79.

anxheloo avatar Jun 18 '25 09:06 anxheloo

+1 Facing this issue

I am adding a simple ViroARSceneNavigator and ViroARScene to a modal.

When I close the modal, the app crashes. Will follow this issue and the 2.43.1 testing for updates.

On Ios keep crashing, while on android is better. try adding some conditional rendering also on the SceneNavigator itself

anxheloo avatar Jun 18 '25 09:06 anxheloo

Hey,

Are you still experiencing the issue on iOS when running the Beta of 2.43.1?

If so, please can you report the issue within the Beta-testing channel on Discord. We can then DM with you to better understand your environment and setup as others are no longer reporting this issue in the Beta.

Oliver Edis

CEO

On Wed, 18 Jun 2025, 10:31 anxheloo, @.***> wrote:

anxheloo left a comment (ReactVision/viro#350) https://github.com/ReactVision/viro/issues/350#issuecomment-2983414682

+1 Facing this issue

I am adding a simple ViroARSceneNavigator and ViroARScene to a modal.

When I close the modal, the app crashes. Will follow this issue and the 2.43.1 testing for updates.

On Ios keep crashing, while on android is better. try adding some conditional rendering also on the SceneNavigator itself

โ€” Reply to this email directly, view it on GitHub https://github.com/ReactVision/viro/issues/350#issuecomment-2983414682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZWUVBXYMC326Z2GZXEKSL3EEWVJAVCNFSM6AAAAAB7JEPSYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBTGQYTINRYGI . You are receiving this because you were mentioned.Message ID: @.***>

oliedis avatar Jun 18 '25 09:06 oliedis

I am not able to install it at all.

I am getting :
warn tarball tarball data for file:reactvision-react-viro-2.43.1.tgz (null) seems to be corrupted. Trying again. Error: ENOENT: no such file or directory, open '/Users/anxhelocenollari/Desktop/Bunkart/reactvision-react-viro-2.43.1.tgz'

The other problem i have is that i forked and used it before with react 19 and react native latest. But it still doesnt work with latest version.

anxheloo avatar Jun 18 '25 11:06 anxheloo

@oliedis It still gives freeze on android when i navigate back from the ar screen. The error only happens when i have rendered an ViroARImageMarker inside an ViroARScene. When i track the source and show a video , than i try to go back, it freezes. But if i dont track the image and go back it works.

This is my ViroArSceneNavigator:

<View style={StyleSheet.absoluteFill}> <View style={styles.container}> {remoteVideoUrl && ( <ViroARSceneNavigator ref={sceneRef} numberOfTrackedImages={1} autofocus initialScene={{ scene: ArScene, }} style={styles.container} /> )} </View> </View>

This is my ArScene:

<ViroARScene onTrackingUpdated={handleTrackingUpdated}> <ViroARImageMarker target="targetOne" onAnchorFound={handleAnchorFound} onAnchorRemoved={handleAnchorRemoved}> <ViroNode rotation={[-90, 0, 0]}> <ViroVideo source={videoPath} height={0.1 * (4 / 3)} width={0.1} position={[0, 0, 0]} scale={[1, 1, 1]} loop={true} muted={false} volume={1} visible={true} /> </ViroNode> </ViroARImageMarker> <ViroARImageMarker target="targetTwo" onAnchorFound={handleAnchorFound} onAnchorRemoved={handleAnchorRemoved}> <ViroNode rotation={[-90, 0, 0]}> <ViroVideo source={videoPath2} width={0.1} height={0.1} position={[0, 0, 0]} scale={[1, 1, 1]} loop={true} muted={false} volume={1} visible={true}/> </ViroNode> </ViroARImageMarker> </ViroARScene>

Also handleAnchorRemoved is not working at all

anxheloo avatar Jun 18 '25 13:06 anxheloo

Are you having this issue with the beta version though? It sounds like you can't install the bets version?

Oliver Edis

CEO

On Wed, 18 Jun 2025, 14:28 anxheloo, @.***> wrote:

anxheloo left a comment (ReactVision/viro#350) https://github.com/ReactVision/viro/issues/350#issuecomment-2984216828

@oliedis https://github.com/oliedis It still gives freeze on android when i navigate back from the ar screen. The error only happens when i have rendered an ViroARImageMarker inside an ViroARScene. When i track the source and show a video , than i try to go back, it freezes. But if i dont track the image and go back it works. This is my ViroArSceneNavigator: {remoteVideoUrl && ( )} ,

This is my ArScene:

<ViroNode rotation={[-90, 0, 0]}> <ViroVideo source={videoPath} height={0.1 * (4 / 3)} width={0.1} position={[0, 0, 0]} scale={[1, 1, 1]} loop={true} muted={false} volume={1} visible={true} />

<ViroARImageMarker target="targetTwo" onAnchorFound={handleAnchorFound} onAnchorRemoved={handleAnchorRemoved}> <ViroNode rotation={[-90, 0, 0]}> <ViroVideo source={videoPath2} width={0.1} height={0.1} position={[0, 0, 0]} scale={[1, 1, 1]} loop={true} muted={false} volume={1} visible={true} /> </ViroNode> </ViroARImageMarker> </ViroARScene>. Also handleAnchorRemoved is not working at all.

โ€” Reply to this email directly, view it on GitHub https://github.com/ReactVision/viro/issues/350#issuecomment-2984216828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZWUVGK6HVG6HU74Y2PER33EFSPLAVCNFSM6AAAAAB7JEPSYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBUGIYTMOBSHA . You are receiving this because you were mentioned.Message ID: @.***>

oliedis avatar Jun 18 '25 14:06 oliedis

@oliedis I am not able to install the bets version. Error: warn tarball tarball data for file:reactvision-react-viro-2.43.1.tgz (null) seems to be corrupted. Trying again. Error: ENOENT: no such file or directory, open '/Users/anxhelocenollari/Desktop/Bunkart/reactvision-react-viro-2.43.1.tgz'

Am i missing something? Should i download the whole project, make changes to be compatible with react 19 and latest react native and than host it in my github and than install?

anxheloo avatar Jun 18 '25 14:06 anxheloo

@oliedis I cloned the whole viro repo, changed the branch to na-validation-Eduardo, changed the versions of react and react native to have it compatible with react 19 and react native 0.79. Added React.JSX.Element as return type in typescript but i am getting: Viro: New Architecture is not enabled. This library requires React Native New Architecture. But i am already using new Architecture since im using react 19 and react native 0.79. Note: i had the library installed before by forking the main repo and make changes to the versions and files i mentioned above. With the forked version it crashes completly on ios when going back while on the beta version modified gives the new architecture error.

anxheloo avatar Jun 19 '25 10:06 anxheloo

@oliedis I am also happy to check if this issue persists with the BETA Version. After installing the beta version with Expo 52/React Native 0.76.9/React 18.3.1, I am observing the Folly error that was shared in the Discord Beta testing channel.

โŒ  (ios/Pods/Headers/Public/RCT-Folly/folly/portability/Config.h:20:10)

  18 | 
  19 | #ifndef FOLLY_NO_CONFIG
> 20 | #include <folly/folly-config.h>
     |          ^ 'folly/folly-config.h' file not found
  21 | #endif
  22 | 
  23 | #if __has_include(<features.h>)

โ€บ Compiling @reactvision/react-viro Pods/ViroFabric ยป ViroFabricContainerManager.mm
โ€บ Compiling @reactvision/react-viro Pods/ViroFabric ยป ViroFabricContainerComponentView.mm

โŒ  (ios/Pods/Headers/Public/RCT-Folly/folly/portability/Config.h:20:10)

  18 | 
  19 | #ifndef FOLLY_NO_CONFIG
> 20 | #include <folly/folly-config.h>
     |          ^ 'folly/folly-config.h' file not found
  21 | #endif
  22 | 
  23 | #if __has_include(<features.h>)

I saw your announcement and Eduardo's messages that the Folly error is resolved in the next Beta version coming in 1-2 days. I will wait and try again with the new Beta version.

malika-k avatar Jun 20 '25 16:06 malika-k

Any luck with this issue? I downgraded to 2.41.6 but same crash.

I simply cannot navigate back from AR Scene.

matifjaved23 avatar Jul 12 '25 07:07 matifjaved23

The team is currently working on a new version Solving all the bugs. Patience, they will have soon a new version

anxheloo avatar Jul 12 '25 10:07 anxheloo

Any solution to the crash related to unmountin scene? It seems to still happen sometimes with the new release version 2.43.4

anxheloo avatar Aug 31 '25 10:08 anxheloo