Unity-Technologies / uaal-example

Other
736 stars 234 forks source link

Getting bunch of errors while integrating unity as library into ios native project, in which both unity and native project contains Firebase libraries. #57

Open vishnunairvp opened 2 years ago

vishnunairvp commented 2 years ago

I have an iOS native project and a Unity project.

What i am trying to achieve? - On a button click from the native ios app, i want to show unity in which both the native and ios project contains firebase dependencies. What i am actually getting? - When i try to run the app in xcode, i am getting following errors (almost 4000 similar error but for different Targets): "Multiple commands produce '/Users/M_742794/Library/Developer/Xcode/DerivedData/MarkersLab-gpaeablwazuyowbfwysavwxcotrv/Build/Products/Debug-iphoneos/BoringSSL-GRPC/openssl_grpc.framework/Headers/cipher.h': 1) Target 'BoringSSL-GRPC' (project 'Pods') has copy command from '/Users/M_742794/Developer/iOS/Development/iOS AR Build/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h' to '/Users/M_742794/Library/Developer/Xcode/DerivedData/MarkersLab-gpaeablwazuyowbfwysavwxcotrv/Build/Products/Debug-iphoneos/BoringSSL-GRPC/openssl_grpc.framework/Headers/cipher.h' 2) Target 'BoringSSL-GRPC' (project 'Pods') has copy command from '/Users/M_742794/Developer/iOS/Development/unity-AR-Build/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h' to '/Users/M_742794/Library/Developer/Xcode/DerivedData/MarkersLab-gpaeablwazuyowbfwysavwxcotrv/Build/Products/Debug-iphoneos/BoringSSL-GRPC/openssl_grpc.framework/Headers/cipher.h'"

Steps i followed for unity integration to my native project -

  1. imported Firebase libraries like Auth, storage, firestore, core in unity and created an iOS build.
  2. Podfile has been generated after the build and i installed the firebase pods.
  3. I have added the Unity-iPhone.xcodeproj along with its Pods.xcodeproj to my native project workspace with the project structure as below(masked is my native xcodeproj):
Screenshot 2021-11-22 at 2 10 07 PM
  1. followed the steps mentioned in this uaal link https://github.com/Unity-Technologies/uaal-example/blob/master/docs/ios.md properly like:

    1. Added UnityFramework.framework to the native app general settings framework, libraries and embedded content and removed the same from Build phases Link binary with libraries section.
    2. Added Unity-iPhone.xcodeproj's Data folder target membership to UnityFramework.
    3. Added Unity-iPhone.xcodeproj's NativeCallProxy file target membership to UnityFramework with public access.
    4. made code changes in native project to show unity on button click.
  2. I have firebase dependencies in my native xcode project as well as unity xcode project and the podfiles are as below:

    • Unity Xcode project Podfile: Screenshot 2021-11-22 at 2 22 36 PM

    • Native Xcode project Podfile: Screenshot 2021-11-22 at 2 23 02 PM

  3. I have installed the pods for both the projects and started building in xcode.

  4. The build is failing with number of "Multiple commands produce" errors: Error

  5. The errors might be causing due to firebase dependency in both native and unity projects but could not find proper solution for this issue. I am expecting solutions from this group for my problem, Thanks!

vishnunairvp commented 2 years ago

Try deleting your derived data!

https://programmingwithswift.com/delete-derived-data-xcode/

I tried deleting derived data but it didnt solved the problem.

vishnunairvp commented 2 years ago

To people who face the same issue, keep only a single podfile with multiple targets (native xcode project and unity xcode project). Refer the link for example https://stackoverflow.com/a/42480097/11061458 .