azesmway / react-native-unity

MIT License
273 stars 67 forks source link

MTLTextureDescriptor has width of zero. #4

Open thibaultcapelli opened 2 years ago

thibaultcapelli commented 2 years ago

Hello,

First of all, thanks for your work :) I'm working on a school project which use this module.

We embeded a Unity project with success with your old module react-native-unity-play. Sadly the postMessage method did not seems to work.

As we noticed you published this new version, we decided to have a try this week without success :/ We have an error with metal whith the message: MTLTextureDescriptor has width of zero. It looks like it is the same issue than here.

We cared about unset the Requires Fullscreen and Status Bar Hidden, as recommended in the old documentation. We guess it is related about some Unity config. It looks like the Unity view can't find its dimensions but we have no idea why.

Do we missed something?

azesmway commented 2 years ago

Monosnap 2022-04-04 12-46-45 you can try to disable this checkbox

also in the folder example there are Unity source. you can see unity settings there

thibaultcapelli commented 2 years ago

Thanks for your response @azesmway

We already tried to uncheck API Validation without success.. I'll try to embed your project instead of ours this evening to be sure there is no diff between our configs. We come back soon to let you know

thibaultcapelli commented 2 years ago

Hello @azesmway

I did not have have a lot time this week to work on this issue, so sorry for the late.

They was no difference in your Unity config and mine.

The issue was just that my parent View had no size........ I had actually only a button which was in absolute position.

I think you should manage this error from the native side or at least mention it in the documention cause it makes crash the app which can be confusing.

Thanks again for your work ;)

azesmway commented 2 years ago

Hello @azesmway

I did not have have a lot time this week to work on this issue, so sorry for the late.

They was no difference in your Unity config and mine.

The issue was just that my parent View had no size........ I had actually only a button which was in absolute position.

I think you should manage this error from the native side or at least mention it in the documention cause it makes crash the app which can be confusing.

Thanks again for your work ;)

Hello! Could you help me and write about this error and how to fix it, and I will add it to the description?

thibaultcapelli commented 2 years ago

I submitted a PR to add it to the doc

https://github.com/azesmway/react-native-unity/pull/7

azesmway commented 2 years ago

I submitted a PR to add it to the doc

7

Thanks for the help!

daniel-keen commented 2 years ago

Monosnap 2022-04-04 12-46-45 you can try to disable this checkbox

also in the folder example there are Unity source. you can see unity settings there

Unfortunately, it didn't help.. are there any thoughts of what that could be?

m90khan commented 2 years ago

Hi @azesmway : Sorry for posting here but apparently, I am facing the same issue. this has become a critical bug now on iOS. @thibaultcapelli and @thexdd : Did you guys manage to solve it? Any lead would be super helpful.

azesmway commented 2 years ago

Hi @azesmway : Sorry for posting here but apparently, I am facing the same issue. this has become a critical bug now on iOS. @thibaultcapelli and @thexdd : Did you guys manage to solve it? Any lead would be super helpful.

Hi! I have not encountered such a problem, there is no such error in my project

daniel-keen commented 2 years ago

@m90khan just make sure your component gets wrapped in a with the following style: { position: 'absolute' width: '100%', height: '100%' }

worked for me

m90khan commented 2 years ago

@thexdd : Sadly, it did not work. it has to do something with ARCoreExtensions (could be wrong) that is causing it. the Ui becomes unresponsive a second time on iOS. do you have any other lead?

Everything works well in android but iOS is an pain.