viromedia/viro

The current state of Viro

gtebbutt opened this issue · 11 comments

I'm a newcomer to viro, and it's been a bit of a struggle to get up and running, so I'm trying to pull together all of the relevant information in one place.

It appears that this library is in danger of becoming unmaintained, which would be a real shame as it's a hugely impressive piece of work, not to mention the only viable AR library for React Native right now.

Key issues

  • The iOS build depends on the now-deprecated UIWebView, meaning that apps using Viro will be rejected from the App Store (#852, #864)

  • The current version was built to target RN 0.59, however there have been significant changes in how native code is linked and integrated in 0.60 and higher (#917)

  • The react-viro-cli depends on a globally installed react-native-cli, which is deprecated in favour of npx react-native

Forks

Going through those issue, it looks like there's some fragmentation happening in terms of attempted fixes:

  • mendix/viro (aka @HedwigAR's fork) is the version I've chosen to use. It removes the GVR (Google VR library) functionality entirely. This fork also cleanly targets RN 0.61, with an open PR for 0.63 (current at the time of writing). The readme clearly states that this fork is for their internal use and should be considered unsupported: "Use on your own risk.".

  • tiknil/viro (aka the citychallenge fork) provides an alternate GVR-removed build, currently targeting RN 0.62.

  • doranteseduardo/viro provides a RN 0.63 build that does not remove GVR, so for now can only be deployed on Android stores. @doranteseduardo has also created a Discord server, and offered to work as a maintainer (#917), but so far that doesn't seem to have been approved.

  • There are also a variety of binaries being passed around in Google Drive links (#852). This doesn't seem a safe or sustainable option in the long run.

Working install process (iOS)

  • Start from an existing or new React Native 0.63 project. Begin with npx react-native init AwesomeProject if you have a totally blank slate.

  • Add the RN 0.63 branch of the mendix fork to package.json as follows: "react-viro": "mendix/viro#nalm/rn63"

  • Add the relevant asset types to metro.config.js:

+const defaultAssetExts = require("metro-config/src/defaults/defaults").assetExts;

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
+  resolver: {
+    assetExts: [
+      ...defaultAssetExts,
+      "obj", "mtl", "JPG", "vrx", "hdr", "gltf", "glb", "bin", "arobject"
+    ]
+  },
};
  • Add the following two lines to ios/Podfile, directly below use_react_native!(:path => config["reactNativePath"]), and run pod install:
pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
pod 'ViroKit_static_lib', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.podspec'
  • In Xcode -> Build Settings, disable bitcode.

  • In Xcode -> Product -> Scheme -> Edit Scheme..., set the Build Configuration to Release.

  • In your Info.plist file add the 'Privacy - Camera Usage Description' Key with description being 'Used for AR/VR'.

Current install process (Android)

TBD

Next steps

In the short term, I'll at least try to keep this issue current so that new users don't have to dig through a whole set of issues and conflicting info to get started.

In the longer term, it would be very helpful if we can:

  • Get some authoritative info from the current maintainers about the status of the project.

  • Add maintainers here or agree on a single fork to continue development on.

  • Merge in the relevant updates for React Native >=0.63, including CocoaPods and AndroidX.

  • Fully replace any dependencies on UIWebView, to allow App Store approvals of the official build.

Thanks Eduardo, glad to hear that there's work planned on that fork and that you have some other developers on board - having an actively maintained build without UIWebView and with GVR retained would be brilliant. I'll try to keep this issue updated as that progresses, and potentially becomes the main development fork in future.

@dthian It would be great if you had any input, as well. Are there any official plans for this repo, either in terms of updates on the roadmap or in terms of adding maintainers?

Thanks for putting this together @gtebbutt.

I want to mention that many developers joined our Discord server (also from Slack) and I discontinued my fork in favour of the new Viro Community. We're planning to solve the UIWebView thing without remove GVR but migrating from GVR to Google Cardboard, making Viro compatible with autolinking to make installation easier and bump to the latest ARCore & ARKit. It's a long path to walk, everyone is welcome to join and contributors wanted!

For reference this seems to be the new community fork mentioned on Discord, https://github.com/ViroCommunity/viro.

Wanted to express thanks for this thread! I had a lot of fun with viro a couple of years ago.

I've tried the instructions from @gtebbutt mntioned Working install process (iOS) from the initial post, but I get Invarient Violations for all Viro components inside the ViroARSceneNavigatior. (This was on iOS 14, an iPhone 8, using RN 63 running against "react-viro": "mendix/viro#nalm/rn63".)

I'm going to pivot and look at the ViroCommunity fork next.

Anyone here still looking at any other options? I'd be happy to help with whichever project gets the most traction, just joined the discord @mattvot mentioned, but wanted to make sure this thread got updated, as it might help others stumble in that direction.

My small update as well.
I wanted to try AR and found Viro. I had high hopes but after reading this thread and install issues, I found out that the CTO and co-founder of Viro left to Snapchat. https://www.linkedin.com/in/raj-advani-ny/
It's pity they didn't update their website for people to know.

vlkpa commented

I'm a newcomer to viro, and it's been a bit of a struggle to get up and running, so I'm trying to pull together all of the relevant information in one place.

It appears that this library is in danger of becoming unmaintained, which would be a real shame as it's a hugely impressive piece of work, not to mention the only viable AR library for React Native right now.

Key issues

  • The iOS build depends on the now-deprecated UIWebView, meaning that apps using Viro will be rejected from the App Store (#852, #864)
  • The current version was built to target RN 0.59, however there have been significant changes in how native code is linked and integrated in 0.60 and higher (#917)
  • The react-viro-cli depends on a globally installed react-native-cli, which is deprecated in favour of npx react-native

Forks

Going through those issue, it looks like there's some fragmentation happening in terms of attempted fixes:

  • mendix/viro (aka @HedwigAR's fork) is the version I've chosen to use. It removes the GVR (Google VR library) functionality entirely. This fork also cleanly targets RN 0.61, with an open PR for 0.63 (current at the time of writing). The readme clearly states that this fork is for their internal use and should be considered unsupported: "Use on your own risk.".
  • tiknil/viro (aka the citychallenge fork) provides an alternate GVR-removed build, currently targeting RN 0.62.
  • doranteseduardo/viro provides a RN 0.63 build that does not remove GVR, so for now can only be deployed on Android stores. @doranteseduardo has also created a Discord server, and offered to work as a maintainer (#917), but so far that doesn't seem to have been approved.
  • There are also a variety of binaries being passed around in Google Drive links (#852). This doesn't seem a safe or sustainable option in the long run.

Working install process (iOS)

  • Start from an existing or new React Native 0.63 project. Begin with npx react-native init AwesomeProject if you have a totally blank slate.
  • Add the RN 0.63 branch of the mendix fork to package.json as follows: "react-viro": "mendix/viro#nalm/rn63"
  • Add the relevant asset types to metro.config.js:
+const defaultAssetExts = require("metro-config/src/defaults/defaults").assetExts;

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
+  resolver: {
+    assetExts: [
+      ...defaultAssetExts,
+      "obj", "mtl", "JPG", "vrx", "hdr", "gltf", "glb", "bin", "arobject"
+    ]
+  },
};
  • Add the following two lines to ios/Podfile, directly below use_react_native!(:path => config["reactNativePath"]), and run pod install:
pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
pod 'ViroKit_static_lib', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.podspec'
  • In Xcode -> Build Settings, disable bitcode.
  • In Xcode -> Product -> Scheme -> Edit Scheme..., set the Build Configuration to Release.
  • In your Info.plist file add the 'Privacy - Camera Usage Description' Key with description being 'Used for AR/VR'.

Current install process (Android)

TBD

Next steps

In the short term, I'll at least try to keep this issue current so that new users don't have to dig through a whole set of issues and conflicting info to get started.

In the longer term, it would be very helpful if we can:

  • Get some authoritative info from the current maintainers about the status of the project.
  • Add maintainers here or agree on a single fork to continue development on.
  • Merge in the relevant updates for React Native >=0.63, including CocoaPods and AndroidX.
  • Fully replace any dependencies on UIWebView, to allow App Store approvals of the official build.

Have somebody tried install viro on androind (with success) ? We need working install proccess like you wrote for IOS.

Currently, the ViroCommunity fork is working on both Android and iOS.

We're planning to solve the UIWebView thing without remove GVR but migrating from GVR to Google Cardboard, making Viro compatible with autolinking to make installation easier and bump to the latest ARCore & ARKit. It's a long path to walk, everyone is welcome to join and contributors wanted!

Hello Eduardo. Exploring how to integrate AR for an upcoming project. This library looks very promising. You mentioned it is working on Android and iOS. Does it have support for what you mentioned such as solving the UIWebView, migration to Google Cardboard, support for auto-linking and support for the latest ARCore/ARKit? Any gotchas you are aware of?

Currently, the ViroCommunity fork is working on both Android and iOS.

What about versioning and latest updates to React Native? Latest RN version is 0.63, and as I see here https://docs.viromedia.com/docs/releases - react-viro suppose to go along the RN updates. Are there plans to continue development of this code in the future? If so - where can we find a good docs or at least some up to date roadmap?

A quick update relevant to this thread: The Readme was just updated. Further development of viro is going on in the Viro Community repo :-)

ℹ️ Active development for Viro is now occurring at the Viro Community fork. We encourage all Viro developers to follow and get the latest updates at ViroCommunity/viro

A quick update relevant to this thread: The Readme was just updated. Further development of viro is going on in the Viro Community repo :-)

ℹ️ Active development for Viro is now occurring at the Viro Community fork. We encourage all Viro developers to follow and get the latest updates at ViroCommunity/viro

but, how to remove UIwebview with [ViroCommunity/viro]