azesmway / react-native-unity-play

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

Screen still black on reboot #5

Open Betapig1 opened 3 years ago

Betapig1 commented 3 years ago

I unchecked the options you told me to. However I still can't restart the unity project in the app without it become a black screen. Even just pressing the button to close it and restart it

azesmway commented 3 years ago

to help - I need the project itself that you are running so that I can check it locally

Betapig1 commented 3 years ago

Okay, I can get that to you in about 5 minutes or so. It just needs to upload

Betapig1 commented 3 years ago

Here you go https://drive.google.com/file/d/1P8qwx9LOjKDGv0S75X88f-LimeJRtgPu/view?usp=sharing

Betapig1 commented 3 years ago

Which version of unity are you using to test btw?

azesmway commented 3 years ago
image
azesmway commented 3 years ago

https://drive.google.com/file/d/1XlvT9Pedl5egjJTbnoFT1JsnbgyNG34P/view?usp=sharing

Betapig1 commented 3 years ago

What exactly is this?

azesmway commented 3 years ago

I put together the project that you sent and made an apk

Betapig1 commented 3 years ago

Did you fix the issue?

azesmway commented 3 years ago

no, I just put together a project I can tell you how

Betapig1 commented 3 years ago

Well the thing is if I wanted an apk I would have just make an apk. But what i was looking for help on was fixing my issue

azesmway commented 3 years ago

Is my apk working correctly for you?

Betapig1 commented 3 years ago

Whether the apk works or not is irellavent. I can't put an apk in my react native project

azesmway commented 3 years ago

do you want me to tell you how I build my project? or what?

Betapig1 commented 3 years ago

If what you did got it to work then sure

azesmway commented 3 years ago

Here you go https://drive.google.com/file/d/1P8qwx9LOjKDGv0S75X88f-LimeJRtgPu/view?usp=sharing

I download this project open with unity

image

uncheck

image

export project for android dir

image

change file - unity/builds/android/build.gradle

allprojects {
    buildscript {
        repositories {
            mavenCentral()
            google()
            jcenter()
        }

        dependencies {
            classpath 'com.android.tools.build:gradle:4.1.3'

        }
    }

change file - unity/builds/android/unityLibrary/build.gradle

//    implementation(name: 'native-toolkit', ext:'aar')
//    implementation(name: 'support-compat-27.1.1', ext:'aar')
//    implementation(name: 'support-v4-27.1.1', ext:'aar')

remove from file - unity/builds/android/unityLibrary/src/main/AndroidManifest.xml

      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>

copy all files from "unity/builds/android/unityLibrary/libs/." to "android/app/libs/."

make build

SoDaBearJess commented 3 years ago

I have the same problem, and I did all the steps you listed on your latest post. The problem is slightly hard to reproduce because it doesn't happen all the time and it never happens when it's a development build from my computer. It only happens when I open the existing app from my phone, but it doesn't always happen. The unity view will say "made with unity" and show the logo, but then the view is black.

I was reading the logcat in Android Studio, and the only difference between when it does show up and when it doesn't is a line saying: UnityEngine.XR.Management.XRGeneralSettings:Awake() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

codyyz commented 2 years ago

No error is there but still the Unity app is not loading, need support for plain boilerplate code for react-native and unity.

azesmway commented 2 years ago

No error is there but still the Unity app is not loading, need support for plain boilerplate code for react-native and unity.

Hi! For this i need a simple unity project that i could use as an example

codyyz commented 2 years ago

No error is there but still the Unity app is not loading, need support for plain boilerplate code for react-native and unity.

Hi! For this i need a simple unity project that i could use as an example

Thanks, this drive link has both basic unity and react native code:

https://drive.google.com/drive/folders/16WXe0eldVSvavQF4cFpoWneEDGe76VE_?usp=sharing

I have tried the same unity (In 2020.3.15f1 and 2020.3.19f1) code with reactnative 0.64.1, 0.65.1 and 0.66.0

azesmway commented 2 years ago

No error is there but still the Unity app is not loading, need support for plain boilerplate code for react-native and unity.

Hi! For this i need a simple unity project that i could use as an example

Thanks, this drive link has both basic unity and react native code:

https://drive.google.com/drive/folders/16WXe0eldVSvavQF4cFpoWneEDGe76VE_?usp=sharing

I have tried the same unity (In 2020.3.15f1 and 2020.3.19f1) code with reactnative 0.64.1, 0.65.1 and 0.66.0

Add Example https://drive.google.com/file/d/1D3oaHstzlmIAvIqzbwfSTwlonxJev7Yh/view?usp=sharing

I used another unity project. if, according to my example, you cannot start your project - write

azesmway commented 2 years ago

I used MacOS and iMac for build project And Android Studio & Xcode

codyyz commented 2 years ago

No error is there but still the Unity app is not loading, need support for plain boilerplate code for react-native and unity.

Hi! For this i need a simple unity project that i could use as an example

Thanks, this drive link has both basic unity and react native code: https://drive.google.com/drive/folders/16WXe0eldVSvavQF4cFpoWneEDGe76VE_?usp=sharing I have tried the same unity (In 2020.3.15f1 and 2020.3.19f1) code with reactnative 0.64.1, 0.65.1 and 0.66.0

Add Example https://drive.google.com/file/d/1D3oaHstzlmIAvIqzbwfSTwlonxJev7Yh/view?usp=sharing

I used another unity project. if, according to my example, you cannot start your project - write

Thanks a lot for the example code, due to which could see reference code. This help in creating custom build and is now working on same environment.