juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.15k stars 526 forks source link

Runner project is not using pods and frameworks of Unity-iPhone project #565

Open kjyv opened 2 years ago

kjyv commented 2 years ago

Describe the bug We have a Unity project that uses cocoapods (for Firebase, ARCore Extensions) which are usually added fine from a Pods project in the workspace. When exporting the project for the flutter unity widget (using the plugin menu -> Export iOS) and then following the readme, we add the Unity-iPhone project to the flutter workspace project. However, when building the Runner workspace, the flutter pods project only includes whatever was specified in the pubspec.yaml - and manually adding the pods through flutter packages is not always possible and also produces new errors, missing pods etc. What is the proper way of making the Runner project build with the full unity-as-a-library project that includes pods and frameworks?

Unity (please complete the following information):

Ahmadre commented 2 years ago

This seems to me a configuration and caching error.

At first: I am also using Firebase (all kind of firebase products), ARKit and other Pods.

I am also using flavors for my Unity-Flutter projects and have no errors on running and building with pods.

#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
...

?

kjyv commented 2 years ago

We've settled on including the relevant lines from the Unity project's Podfile in the flutter Podfile manually which does the trick. Including the xcconfig is also an interesting way to do it that we didn't know of. The line above looks like it will only include the Pods for the Runner project though, it won't know of the Pods of the Unity project. You're saying you're using Firebase, ARKit etc. - do you mean in the flutter app or the unity packages?

ITR13 commented 2 years ago

We've settled on including the relevant lines from the Unity project's Podfile in the flutter Podfile manually which does the trick.

How did you do this? I think I might be having the exact same issue as you and I've tried everything online (including the stuff in @Ahmadre's questions) to no avail.

yggie commented 1 year ago

I solved this on xcode adding the missing pod project to the Unity-iPhone group (right-click on the Unity-iPhone project then use Add Files to “Unity-iPhone”, for me the project was in ios/UnityLibrary/Pods/Pods.xcodeproj). This solved the problem for me.