flutter-unity-view-widget
flutter-unity-view-widget copied to clipboard
Runner project is not using pods and frameworks of Unity-iPhone project
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):
- OS: macOS 12.3.1
- Version 2021.3.1f
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.
- My first question: are you running
flutter clean
before you made any changes to your Pods? - Did you delete your
Podfile.lock
file? - Did you delete your
Derived data
in XCode? (Derived data makes a lot of problems though...) - Are your
Debug.xcconfig
andRelease.xcconfig
looking like this:
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
...
?
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?
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.
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.