Open marekzd opened 2 years ago
This issue does not seem to follow the issue template. Make sure you provide all the required information.
According to your description, I have a feeling that this is an issue with GoogleSignIn iOS pod, since you are using an empty project with a single Dependencies.xml
file. What EDM4U does is basically generating a Podfile
under the Xcode project and run pod install
.
But before I jump into conclusion, I would like to learn a bit more about your situation.
Podfile
under the exported Xcode project? What is the content?Unity-iPhone.xcworkspace
? Does it exist under your Xcode project folder?Did you see Podfile under the exported Xcode project? What is the content?
Yes, here you have it:
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'GoogleSignIn', '~> 6.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
Did you open Xcode project using Unity-iPhone.xcworkspace? Does it exist under your Xcode project folder?
Unity opened Unity-iPhone.xcworkspace
for me after clicking on Build and Run
.
Yes, Unity-iPhone.xcworkspace
exists under my Xcode project folder.
I have a feeling that this is an issue with GoogleSignIn iOS pod, since you are using an empty project with a single Dependencies.xml file.
I've tried with the following Dependencies.xml
file:
<dependencies>
<iosPods>
<iosPod name="Firebase/RemoteConfig" version="~> 8.15"/>
</iosPods>
</dependencies>
and the problem is the same.
What EDM4U does is basically generating a Podfile under the Xcode project and run pod install.
I think that the project generated by Cocoapods doesn't cope well with ARCH=x86_64
enforced by Unity.
It looks like XCode build system in Debug mode assume that pods don't support x86_64 and don't build them.
It only builds UnityIPhone
UnityFramework
targets.
(I'm using XCode 13.3.1 by the way)
Unfortunately, I don't get how XCode build system plans its buidling...
Unity opened Unity-iPhone.xcworkspace for me after clicking on Build and Run.
Eh, Unity actually does NOT know about xcworkspace
. That is generated by Cocoapod which is not officially supported by Unity yet. That is what EDM4U comes to resolve this. My think Unity is actually opening Unity-iPhone.xcodeproj
which may not contain all the frameworks added by Cocoapod.
Try to open Xcode project using Unity-iPhone.xcworkspace
and see if you still have the issue.
My think Unity is actually opening
Unity-iPhone.xcodeproj
which may not contain all the frameworks added by Cocoapod.
This works fine on my side - Unity opens xcworkspace
after clicking [Build and Run]
.
Here you have a screen of XCode window, that shows up after clicking on [Build and Run]
:
Try to open Xcode project using
Unity-iPhone.xcworkspace
and see if you still have the issue.
I opened Unity-iPhone.xcworkspace
manually and it didn't help.
I've also tried opening Unity-iPhone.xcodeproj
and you are right, it creates the same problem.
So yeah, I have to admit that my problem is similar, though on xcworkspace
and only in Debug mode 😄
I have one more observation: \
Build succeeds when I set Pods project / Build settings / Build Active Architecture Only / Debug
to No
.
Hi @marekzd
Could you try something for me? Just like to narrow down the issue.
Podfile
under your Xcode project.EDM4U
from your Unity project. [Build]
to generate an Xcode projectPodfile
to the new Xcode project.pod install
under the new Xcode project folder..xcworkspace
.Could you try something for me? Just like to narrow down the issue.
Yes, it results in the same error:
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GoogleSignIn'
ld: framework not found AppAuth
I see. In that case, I think this can be a potential issue in GoogleSignIn pod.
I would transfer your issue to their repo so that they can take it from here.
Alright. Seems like I cannot transfer to https://github.com/google/GoogleSignIn-iOS/issues
Here is my recommendation:
Podfile
to the project.Thank you
I think this can be a potential issue in GoogleSignIn pod.
I don't think so.
I think the problem is not related to any specific package.
I've tried adding Firebase/RemoteConfig
or SDWebImage
instead of GoogleSignIn
and the problem remained.
I've also tried removing all dependencies and built with the following Podfile:
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
target 'UnityFramework' do
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
and it also failed with similar error:
ld: framework not found Pods_UnityFramework
I think the problem lies in Unity-iPhone
and Unity-Framework
strange simulator project configuration, Cocoapods inability to cope with that configuration and probably with Apple M1 building environment too.
Did you try to reproduce this bug on your side ?
Hmm, it is odd that Firebase/RemoteConfig
does not work for you.
I tried to build Firebase Analytics Quickstart with Unity 2020.3.18f1
.
9.1.0
Target SDK
to Simulator SDK
Run in XCode as
to Debug
After the Xcode project is created, this is how it looks like in the Podfile
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'Firebase/Analytics', '9.1.0'
pod 'Firebase/Core', '9.1.0'
pod 'Firebase/RemoteConfig', '9.1.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
pod 'GoogleSignIn', '~> 6.0'
to Podfile
, and ran pod install
. Still able to build and run the testapp.Then I tried the project you provided. I was still able to build successfully.
So...this does not seems to be an issue related to either those pods or EDM4U.
Perhaps upgrade Xcode version and see if that works for you?
Hey @marekzd. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I've upgraded XCode to v13.4.1 (13F100).
I've tried the project that I provided and debug build failed with the same linker error as previously.
I've also tried building Firebase Analytics Quickstart following your instructions and it also failed in debug mode and throwing similar error:
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/FirebaseCoreInternal'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/FirebaseInstallations'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/GoogleDataTransport'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/PromisesObjC'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/nanopb'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FirebaseAnalytics/AdIdSupport'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleAppMeasurement/AdIdSupport'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-eufhbklrshjckfetsaksyhbltqrw/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleAppMeasurement/WithoutAdIdSupport'
ld: framework not found FBLPromises
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Did you build on Apple M1 computer ?
I think the problem lies in how Unity configures XCode project and Cocoapods being unable to cope with that on Apple M1.
I was curious whether something changed in newer versions of Unity and I tested my example on Unity v2021.3.5f1 with Cocoapods v1.11.3, but the problem is still there.
I have been able to reproduce this problem on an Apple M1, so I do think that is indeed the problem, and this does only seem to occur when building for Simulator, and Debug. It seems that it is likely a weird interaction with Unity, XCode, and Cocoapods, and we will see if there is a workaround we can implement. Trying suggestions that I have found on similar issues has not resulted in any success yet, unfortunately.
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
Build for iOS Simulator doesn't compile in Debug mode.
XCode throws the following error:
Here are steps to reproduce this:
Editor/Dependencies.xml
fileProject Settings / Player
and setiOS Target
toSimulator SDK
Build Settings...
and switch toiOS
platformRun in XCode as
toDebug
Build and Run
framework not found AppAuth
Release
modePlease answer the following, if applicable:
What's the issue repro rate? (eg 100%, 1/5 etc) 100%
What happened? How can we make the problem occur?
Unity enforces
x86_64
architecture forUnity-iPhone
andUnityFramework
targets (ARCHS=x86_64
).It seems that XCode is not able to build pods in
x86_64
architecture in Debug mode. Although it can do that in Release mode.I'm not sure why that happens.
It might be related to
Build Active Architecture Only
being set for Debug builds. It also might be related to Apple M1.Here you can find a sample project: EDM4UiOSSimulatorDebugBug.zip