azesmway / react-native-unity

MIT License
263 stars 61 forks source link

Multiple commands produce #109

Open MuratDemirel opened 6 months ago

MuratDemirel commented 6 months ago

I need to add a Unity project to my own project using @azesmway/react-native-unity. Source project using @azesmway/react-native-unity@0.3.0 To do this, I copied the Unity folder into my project, installed the @azesmway/react-native-unity package using yarn, and installed the pods. When I tried to run my project in Xcode, I encountered 56 errors. All of them are related to repeated copying in the headers section of the react-native-unity pod. Some of the files are as follows:

Allocator.h Array.h Assemply.h AssemplyName.h Assert.h Atomic.h COM.h ConditionVariable.h Debugger.h Encoding.h Enum.h Environment.h Error.h Event.h EventImpl.h Exception.h FastReaderReaderWriterLockImpl.h

Screen Shot 2024-03-26 at 23 23 09 PM Screen Shot 2024-03-26 at 23 23 36 PM

azesmway commented 6 months ago

You need to completely remove everything that relates to Unity in XCode and only then install a new one according to the instructions

MuratDemirel commented 6 months ago

I've created a brand new react native project and did everything in the instructions step by step. Multiple commands errors fixed but now have i another errors.

Screenshot 2024-03-28 at 03 22 02
azesmway commented 6 months ago

all errors on the screenshot refer only to Unity - the plugin does not use such errors

jannisringwald commented 3 months ago

@MuratDemirel how did you fixed it?

markrickert commented 3 weeks ago

Just wanted to chime in here after I ran across this exact same error. The solution is to delete and extra Headers folder that might be in your ./unity/builds/ios/ folder. In my case i had a Headers folder that contained the exact same files as my ./unity/builds/ios/Unityframework.framework/Headers/* folder.

Deleting the duplicated header files fixed this issue for me. The ONLY thing in the unity/builds/ios folder should be the UnityFramework.framework folder.

Opening the project and selecting the pods project and then the react-native-unity pod, selecting "Build Phases" and then Headers->Public showed the extra header entries:

Before After
Screenshot 2024-09-06 at 1 37 32 PM Screenshot 2024-09-06 at 1 55 48 PM