riderodd / react-native-ar

React native AR model viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execution failed for task ':react-native-ar-viewer:compileDebugKotlin'

HimanshiVashist-dev opened this issue · comments

I cloned the react-native-ar-viewer repository and was able to run the example project without any issues. However, when I tried to use the package in my own project, I encountered the following error:

image

I followed the instructions in the package's README file, but I'm still getting this error.

The error message specifically states that there is a type mismatch in the ArViewerView.kt file on line 291, where an inferred type is MotionEvent? but MotionEvent was expected. This suggests that there may be an issue with how the MotionEvent type is being used in the code.

I'm not sure how to resolve this issue, so I would appreciate any help or guidance on how to fix this.

Thank you for your assistance!

Hi! Could you give me an example of the code you used and tell me how you initialized your project ?
Thanks :)

I created a React Native project by running the following command: npx react-native init demo.
Afterwards, I followed the steps outlined in the README.md file.

Step 1: I executed the command npm install react-native-ar-viewer to install the necessary package.

Step 2: I added the following code snippet to the AndroidManifest.xml file:

<meta-data android:name="com.google.ar.core" android:value="required" tools:replace="android:value" />

Step 3: I added the xmlns:tools="http://schemas.android.com/tools" attribute to the tag.

However, when I tried to run the application, I encountered an error which is mentioned in the issue.

For your reference, these are the versions of dependencies I am currently using.

image

I successfully reproduced the issue, i'm currently working on it

Hello ! This should be fixed, please update to 0.1.17 :)

👋 Hi there!

I incorporated the change you suggested into my project and ran it using the following command:

npx react-native run-android

However, when I installed the app on my phone, I encountered the following error.

image

Could you help me rectify this issue?

Thanks for your answer, could you please send me your android/app/src/main/AndroidManifets.xml ?

Thanks for your help😊.

The project is now up and running. The problem I reported earlier has been resolved by following these steps.

Earlier I was adding meta-data tag inside acitivity tag at line 21 like this:

image

The issue is fixed by adding meta-data tag after activity tag at line 27.

Alright, i guess the readme isn't really clear about it, sorry ! I'll change it asap.
I'm glad you get it working, and I'm still here if you need me again !

Glad to hear that! Thanks for helping out :)