thanh-nguyen-kim / Unity_Android_Screen_Recorder

A simpler demo record screen plugin for record Android Screen
GNU General Public License v3.0
101 stars 36 forks source link

No working with ARFoundation in Android #14

Closed DeveloperAugustus closed 3 years ago

DeveloperAugustus commented 3 years ago

I added AR Session origin and AR Session onto sample scene provided with this repository,somehow it is not working; AR Camera is not even opening,even it was tagged Main Camera. Please let me know if there is any fix from you. Have a good day.

thanh-nguyen-kim commented 3 years ago

Could you use the "logcat" to capture the log? May be i can provide for you a fix after have the log.

DeveloperAugustus commented 3 years ago

sure

DeveloperAugustus commented 3 years ago

Screen recorder logs with ARFoundation test apk.pdf let me pls know if this helpful and so far ,the problem is - its recording properly screen, but as i have added AR Session Origin and AR Session in hierrachy, and replaced main camera, now there is just black screen, its not opening camera, as it should automatically ask to allow to give access to camera in AR; I hope you are getting what i'm trying to explain here.

thanh-nguyen-kim commented 3 years ago

Hi. You should comment this line in Plugin/Android/Androidmanifest.xml meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" This line cause your app to skip the camera permission dialog. PS: I add this line to the manifest for another part of my plugin which allow you to delay permission request later when users are using the app.

DeveloperAugustus commented 3 years ago

Hello, which line should i comment out?

 meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" /

Are you referring to this one?

thanh-nguyen-kim commented 3 years ago

yep, i have edit my comment, github hide the line because of XML formatting

DeveloperAugustus commented 3 years ago

Hello, i commented out that part of code, but still not asking for camera permission, even i manually,granted permission, still black screen,and recording is working properly. androidmanifest file.txt

thanh-nguyen-kim commented 3 years ago

You need to add the camera permission to manifest. Here is your manifest after modified https://pastebin.com/VFFN6cqU

DeveloperAugustus commented 3 years ago

Hello , i am getting multiple errors if i am trying to take a build after updating above provided manifest file.

G:\UnityProjects\Unity Screen Recorder github sample\Temp\gradleOut\launcher\build\intermediates\merged_manifests\debug\AndroidManifest.xml:63: AAPT: error: unexpected element found in .

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

thanh-nguyen-kim commented 3 years ago

Sorry, My bad I've sent you a fault AndroidManifest.xml Here is the new one, try it and tell me if it works https://pastebin.com/kbf6txcM

DeveloperAugustus commented 3 years ago

Hello, I changed androidmanifest file, still not working.

thanh-nguyen-kim commented 3 years ago

Sorry for late respond. I've had a very busy week. Can you share me your link to your git project so I can have a look? If It's a private project, could you share the full gradle log? I might have to create a brand new project with AR Foundation to replicate this bug, It will take some time.

DeveloperAugustus commented 3 years ago

Sure, i will share you Git project link here.

Here it is - https://github.com/ThePacerJ/Screen-Recording-Android-ARFoundation

DeveloperAugustus commented 3 years ago

Hey Buddy, problem solved. I changed ARFoundation and ARCore packages version to 3.1.5 I took a build, now its asking for permission and is able to record screen properly. Here it is updated - https://github.com/ThePacerJ/Screen-Recording-Android-ARFoundation Thank You so much for your help! May you have a good day.

thanh-nguyen-kim commented 3 years ago

That is great. Love to hear it.