Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy AR implementation #123

Open
rpassareti opened this issue Jul 11, 2019 · 18 comments
Open

Easy AR implementation #123

rpassareti opened this issue Jul 11, 2019 · 18 comments

Comments

@rpassareti
Copy link

rpassareti commented Jul 11, 2019

Hi everyone,

I'm trying to implement this plugin with EasyAR 3.0, but every effort I did mades the screen black, without activating the camera.

Looking at the logcat, it's seems the easyar couldn't initialize the camera, but when I build a version from unity directly to the device, works normal

Any tip or advice?

I'm using Unity 2018.2.9
React-Native 0.59.10

@igrir
Copy link

igrir commented Aug 7, 2019

@rpassareti I'm using Unity 2019.1.6.f1, React-Native 0.60.4, and EasyAR 3.0.1. I only use Metal for Graphics API (because I'm targeting iOS and also using ARKit for other features). It works fine. I'll try to compile it later into Android

IMG_0410

[Update]

I managed to run it on Android. Some configuration to note of:

  1. Make sure package name which located on app/src/main/AndroidManifest.xml has the same package name with your registered key on EasyAR's website
  2. In Build.Gradle located on UnityExport folder, set the dependencies with this config
    api fileTree(include: ['.jar','.aar'], dir: 'libs')

@rpassareti
Copy link
Author

@igrir can you share your code and project plz?

@igrir
Copy link

igrir commented Aug 8, 2019

@rpassareti
Copy link
Author

rpassareti commented Aug 9, 2019

@igrir thx for the share!

but where did you change the EasyAR Key on the react?

I'm trying to use one of mine EasyAR Key, but when I build to the react gives me that the key is incorrect with the bundle.

I noticed that you deleted your key (no problem with that), but when I created one of mine, and put on the EasyARKey at unity works, but not on the React.

[Edit]
ok.... FINALLY I could made my project works!!!!

things that I learned and I think there is no place talking about it
you CAN'T have more than one project on the Unity folder (on the main folder)

the EasyAR Key works normal, it was something on my machine, restarted it, and start to work again.

now I'm having problem with playing video.

any tips? ;D

@igrir
Copy link

igrir commented Aug 11, 2019

@rpassareti I haven't tried video player on EasyAR

@rpassareti
Copy link
Author

rpassareti commented Aug 12, 2019

@igrir the problem is not the EasyAR
on an apk exported from unity, works normal
but when exported to react, the video stay black and don't play

[EDIT]

on logcat is showing this:

08-12 15:36:02.104 28043 28137 W Unity   : AndroidVideoMedia::OpenExtractor could not translate sharedassets0.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
08-12 15:36:02.104 28043 28137 W Unity   :
08-12 15:36:02.104 28043 28137 W Unity   : (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 328)
08-12 15:36:02.104 28043 28137 W Unity   :
08-12 15:36:02.105 28043 28137 W Unity   : AndroidVideoMedia: Error opening extractor: -10004
08-12 15:36:02.105 28043 28137 W Unity   :
08-12 15:36:02.105 28043 28137 W Unity   : (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 472)

@igrir
Copy link

igrir commented Aug 14, 2019

Is the video embbeded on the apk? Are you sure the video is there? Maybe you can try to check the generated apk using android studio's APK Analyzer. It could be the video didn't added into the APK.

@rpassareti
Copy link
Author

rpassareti commented Aug 14, 2019

will check this, but i think the export doesn't include the video, any idea to do this?

what I did was putting the video on Streaming Asset and works on React build

but some kind of video, like with transparent, doesn't work without passing by a unity transcode, so we will change our video to work with a shader from EasyAR video example

thx for the help!

@JanOwiesniak
Copy link

JanOwiesniak commented Sep 25, 2019

@rpassareti you could try out this package: https://assetstore.unity.com/packages/tools/video/avpro-video-56355

We are using it together with Vuforia to play AR videos and it works great on iOS and Android.

@rpassareti
Copy link
Author

hey @igrir !
i'm having some trouble to build this app to iOS now
what did you do to build it?

@qu4sar
Copy link

qu4sar commented Apr 29, 2020

on logcat is showing this:

any solution ?

@rpassareti
Copy link
Author

on logcat is showing this:

any solution ?

you mean to play the video on react?

i put the video on streaming asset, and played from this folder, and used a shader for transparent video.

but i don't have a workaround for iOS

@qu4sar
Copy link

qu4sar commented May 4, 2020

on logcat is showing this:

any solution ?

you mean to play the video on react?

i put the video on streaming asset, and played from this folder, and used a shader for transparent video.

but i don't have a workaround for iOS

How do you play the video from unity by android's assets folder path ?

@rpassareti
Copy link
Author

rpassareti commented May 5, 2020

on logcat is showing this:

any solution ?

you mean to play the video on react?
i put the video on streaming asset, and played from this folder, and used a shader for transparent video.
but i don't have a workaround for iOS

How do you play the video from unity by android's assets folder path ?

https://docs.unity3d.com/Manual/Video.html

set the VideoPlayer as URL, and follow on the end of the page, to set StreamingAsset video

@ridhoRH
Copy link

ridhoRH commented May 27, 2020

Hi

Any solution on EasyAR showing "Invalid Key"?
It works when I make a Unity Build but shows "Invalid Key" when I run it with react-native-unity-view

@rpassareti
Copy link
Author

@rpassareti here you go https://github.com/igrir/ReactEasyARSample

@ridhoRH clone this project, and use as base for you, this what I did to make it work

@jfilipedias
Copy link

@ridhoRH I had this same Issue. I'm using a node module forked from this repository, that it is just a update to a new Unity Editor and React Native versions.

What helped me was to change the build.gradle file inside the UnityExport directory. In my case, I have a unity-classes.jar and EasyAR.jar file in the UnityExport \ libs directory. So in build.gradle I already had "implementation ': unity-classes'" and I just needed to add "implementation ': EasyAR'" to point to my EasyAR.jar file.

@ridhoRH
Copy link

ridhoRH commented May 28, 2020

@jfilipedias thanks so much. I'm also using the updated one and that solution worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants