azesmway / react-native-unity-play

Play an unity view in react native
MIT License
40 stars 16 forks source link

Black screen after closing and reopening app and restarting unity project #3

Closed Betapig1 closed 3 years ago

Betapig1 commented 3 years ago

When I open the app and open the project then close the app. The next time I open the app and the project the project just shows a black screen

azesmway commented 3 years ago

When I open the app and open the project then close the app. The next time I open the app and the project the project just shows a black screen

Please write in more detail. How do you close the application?

Betapig1 commented 3 years ago

I close the application by opening the list if apps open, and swiping it closed

azesmway commented 3 years ago

Killing the application or removing it to the background?

Betapig1 commented 3 years ago

Killing it completley i believe. The application is no longer open

Betapig1 commented 3 years ago

The only way I can get the project to show again is to uninstall and rebuild the app

azesmway commented 3 years ago

I made a build apk and my test application which I posted with the link and with a real working unit project starts and closes without problems

Betapig1 commented 3 years ago

Did you do it with a development build? Rather than a release apk?

azesmway commented 3 years ago

release apk

Betapig1 commented 3 years ago

If you do it with a dev build you will probably find the same bug

azesmway commented 3 years ago

not, everything works in all variants

Betapig1 commented 3 years ago

Well do you want some of my code? Which files would help you

azesmway commented 3 years ago
image
Betapig1 commented 3 years ago

Okay I'll get that to you in about an hour if that works

Betapig1 commented 3 years ago

here you are https://drive.google.com/file/d/1TV0qtKbJkO75ylrYnqwQxkwhcaUOJ4P0/view?usp=sharing

azesmway commented 3 years ago

https://drive.google.com/file/d/18l0K7FoHNm8_hMqXeno7ZRVabPbKHxue/view?usp=sharing

everything works fine a problem with the screen because the settings from the description were not made

UNITY PLAYER SETTINGS Resolution and Presentation -> Start in fullscreen mode -> no selection set ! Resolution and Presentation -> Render outside safe area -> no selection set !

Betapig1 commented 3 years ago

Ah that makes sense. One more question, how do I include unity packages and assets? Becuase with a different project i get this `

Could not find :native-toolkit:. Required by: project :app project :app > project :unityLibrary Could not find :support-compat-27.1.1:. Required by: project :app project :app > project :unityLibrary Could not find :support-v4-27.1.1:. Required by: project :app project :app > project :unityLibrary`

when i try to run it because it cant find the .aar files

azesmway commented 3 years ago

excuse me - I did not understand the question

Betapig1 commented 3 years ago

Certain unity assets attach .aar files in the libs folder and requires them. However when I load the project in react native it is unable to find them

azesmway commented 3 years ago

Create directory into android/app/libs Copy libs from /unity/builds/android/unityLibrary/libs/* to android/app/libs

Add to build.gradle

allprojects { repositories { flatDir { dirs "$rootDir/app/libs" }