f111fei / react-native-unity-view

Show an unity view in react native
MIT License
403 stars 102 forks source link

Not working on iOS Xcode version(10.1) RegisterMonoModules.h' file not found #94

Open balu3083 opened 5 years ago

balu3083 commented 5 years ago

Hi, I have tried to implement this module on react-native it is working fine in android but when I try to run on iOS I am getting error please check the below log "/Users/emvigo/Documents/Artist-Unity/Chasingcarrotdemo/node_modules/react-native-unity-view/ios/UnityUtils.mm:1:10: 'RegisterMonoModules.h' file not found"

Xcode Version: 10.1 (10B61) Mac OS: 10.14(mojave)

"dependencies": { "react": "16.6.3", "react-native": "0.58.4", "react-native-unity-view": "^1.3.3" }

Thanks Balakrishnan

JanOwiesniak commented 5 years ago

What scripting backend you are using?

You can find this setting here:

Unity > File > Build Settings > iOS > Player Settings > Other Settings > Configuration > Scripting Backend

screenshot 2019-02-21 at 12 03 54

balu3083 commented 5 years ago

Hi, The above settings are same. I found another issue on my unity export build "UnityConfig.xcconfig" file is not generating when I export the ios build from unity. I used the same Cube project.

Thanks Balakrishnan

JanOwiesniak commented 5 years ago

@balu3083 do you still need any help here or is your problem already solved?

mikeyamato commented 5 years ago

I ran into this issue today trying to build out a project in Xcode by following the setup steps laid out on GitHub. I'm going to try and build this out in Android Studio.

talyh commented 5 years ago

Same as @mikeyamato. Is the UnityConfig.xcconfig supposed to be copied as is from the demo repo? Or does it need to be modified somehow with variables for the current project?

JanOwiesniak commented 5 years ago

@talyh UnityConfig.xcconfig must be copied from the demo project (and often need adjustments depending on your project dependencies).

talyh commented 5 years ago

@JanOwiesniak - thanks. I've followed the steps in the README, including step 4 for iOS Build, which is about "Setting .xcconfig to project.". This is a very basic project, just to see if the library will work, so my RN app is what you'd get from react-native init. There are no additional dependencies or anything. I assume no other changes toUnityConfig.xconfig in this scenario, right?

Looking at the demo again, I noticed that my UnityExport was created at the wrong place. The path for it is "../../ios", so it's assuming "RNproject >> unity >> projectFolderName >> Assets". My structure was just "RNProject >> unity >> Assets", which messed up the whole thing.

I'll start from scratch to see if I can get it to work now. 😄 If there's any additional setup I'd need to do at UnityConfig.xconfig, would you please point me to the changes needed?

JanOwiesniak commented 5 years ago

@talyh if you just want too see if "things are working", it is probably easier to use the demo project as a starting point. The dependencies are not up to date but it's way easier to get it up and running than the standalone library here.

talyh commented 5 years ago

@JanOwiesniak - The demo is not working for me, as described at https://github.com/f111fei/react-native-unity-demo/issues/37.

I just finished running another pass of a blank RN project, super simple Unity project, and to the best of my perception followed the README steps to the letter (only deviation was adding ios/UnityExport to .gitignore. This is done using Unity 2019.1.0f2, RN 0.59.8 and RNUV 1.3.3

When building, I get several Semantic Issues inside UnityExport. image

This is separate from the problem tracked here, so I'm glad to open a separate issue if there's really something wrong (versus me doing something wrong). For reference, my basic project is here: https://github.com/talyh/RNUnityIntegrationTest-RNSide and https://github.com/talyh/RNUnityIntegrationTest-UnitySide

abrowne2 commented 5 years ago

@talyh Were you ever able to fix the errors you have above? Looking to use 2019.1 and the rest of your versions with this package.

talyh commented 5 years ago

@abrowne2 - I wasn't. At this point, I'm inclined not to try and use RN with Unity.

georgewwindsor commented 5 years ago

I have additionally ran into this issue: using react-native 59.8

ziyoshams commented 5 years ago

As a workaround, use older version of Unity. I use 2018.2.17f (22 Nov, 2018 release) and it works fine. https://unity3d.com/get-unity/download/archive

zbagley commented 5 years ago

Encountering the same il2cpp and RegisterMonoModules missing headers issue. Using 2019.N (tried on 3, 6, and 10) with RN 0.59.9. Downgrading below 2019 is not acceptable for our use case due to lost features. Will continue exploring this problem, as well as other options beyond this project (Unity as a standalone library).

igrir commented 5 years ago

have you tried to add -DNET_4_0 to OTHER_CFLAGS in UnityConfig.xxconfig?

zbagley commented 5 years ago

@igrir I personally have tried that with no luck. The libil2cpp library appears to be included as well: image

So I'm just trying to figure out why it's using an incorrect namespace: image

zbagley commented 5 years ago

@talyh Possibly relevant: https://github.com/f111fei/react-native-unity-view/issues/118#issuecomment-518304297

Unity reverted the OpenGLES2 settings change which resolved this issue and might be worth looking into.

chellongCoder commented 4 years ago

@igrir I personally have tried that with no luck. The libil2cpp library appears to be included as well: image

So I'm just trying to figure out why it's using an incorrect namespace: image

how to get libil2cpp.a? where is it? after I built export unity, i got libil2cpp but it is folder, not be file.a image

JanOwiesniak commented 4 years ago

@chellongCoder the file should be here

Screenshot 2019-09-26 at 10 26 31

XCode Version 10.3 (10G8) Unity 2018.4.2f1 react-native-unity-view 1.3.3

laura3100 commented 4 years ago

I am having the same issues. I have tried all of the above and they do not work. Does anyone have any other ideas?