flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

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

Open kjyv opened this issue 2 years ago • 3 comments

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

kjyv avatar Apr 27 '22 12:04 kjyv

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 and Release.xcconfig looking like this:
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
...

?

Ahmadre avatar Jun 19 '22 23:06 Ahmadre

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?

kjyv avatar Jun 20 '22 09:06 kjyv

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.

ITR13 avatar Aug 30 '22 18:08 ITR13

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.

yggie avatar Dec 05 '22 14:12 yggie