log

[React Native] viroreact 라이브러리 사용 및 오류 해결 본문

React

[React Native] viroreact 라이브러리 사용 및 오류 해결

sun_young 2023. 8. 13. 22:45

 

ViroReact

AR 및 VR을 빠르게 구축할 수 있는 라이브러리

https://github.com/ViroCommunity/viro

 

GitHub - ViroCommunity/viro: ViroReact: The AR and VR library for React Native 📳🖤💙💛

ViroReact: The AR and VR library for React Native 📳🖤💙💛 - GitHub - ViroCommunity/viro: ViroReact: The AR and VR library for React Native 📳🖤💙💛

github.com

ViroCommunity랑 ViroMedia가 있는데 ViroCommunity가 비교적 최신 버전인 것 같다 Community를 권장!

 

기존 프로젝트에 통합하여 실행할 수도 있는데 IOS/Android 각각 환경 설정이 필요하다

(ios는 엄청 간단한데 안드로이드는 복잡....)

 

처음에 실행이 안 돼서 고생 좀 했는데 처음부터 잘 따라 해보면 실행되긴 하더라

(설명 + 예시 코드를 보여주는데 두 개 같이 보면서 코드 작성하는 게 좋다, 설명만 보면 정확히 어디에 추가해야 하는지 좀 헷갈려서)

 

 

🚨 Could not find com.google.android.exoplayer:exoplayer-core:r2.4.2

이런 오류가 발생할 수 있는데 이건 버전 문제로, implementation 'com.google.android.exoplayer:exoplayer:2.15.1 이걸로 수정해주면 해결!

 

실제 안드로이드 기기에서 실행해야 한다! 

최소 실행 가능한 SDK 버전이 24이기 때문에 너~~~무 오래된 안드로이드 기기는 실행이 어렵다

 

 

근데 막상 빌드 할 때 오류는 안 생기는데 starter-kit의 예시 코드 가져와서 실행하면 로그도 안 찍히고 그냥 계속 앱이 튕겨서 더 알아봐야 할 것 같다ㅠㅠ

 

자세한 사용법과 예시 코드는 아래 문서 확인할 것!
https://viro-community.readme.io/docs/overview

 

Overview

ViroReact is a platform for developers to rapidly build native cross platform AR/VR applications using React Native. ViroReact supports:AR: ARKit and ARCoreVR: Cardboard (iOS and Android), Daydream and Gear VRThe platform is composed of two main components

viro-community.readme.io