- Home /
iOS Build crashing dyld: Symbol not found
Hey!
I'm building my first game for iOS using Unity. I've made and published a few games on Android. iOS is a little trickier, it seems. I generated the xCode project, build it, and it builds fine and then immediately crashes on the simulator.
I have both GoogleMobileAds
and GooglePlayGames
in the project. The logs read this message:
dyld: Symbol not found: _OBJC_CLASS_$_GSDK_GTMSessionFetcher
Referenced from: /Users/slashg0/Library/Developer/CoreSimulator/Devices/FC590B60-F039-47F4-B81E-EF4A99D619D7/data/Containers/Bundle/Application/45238C77-AE2D-4BB5-A98D-F5AE734201E9/auradefence.app/auradefence
Expected in: flat namespace
in /Users/slashg0/Library/Developer/CoreSimulator/Devices/FC590B60-F039-47F4-B81E-EF4A99D619D7/data/Containers/Bundle/Application/45238C77-AE2D-4BB5-A98D-F5AE734201E9/auradefence.app/auradefence
(lldb)
I have followed a lot of threads with similar issues
I've tried
pod install
manually, building from the.xcworkspace
file (which isn't generated by default)I've deleted pods, then installed them manually
I've tried copying
GoogleOpenSource
and a few other libraries, they cause build errors.
I may be overdoing the wrong things here. Can anyone point out what I need to do?
[EDIT 1] Adding the Unity generated Podfile:
source 'https://github.com/CocoaPods/Specs.git'
install! 'cocoapods', :integrate_targets => false
platform :ios, '82'
target 'Unity-iPhone' do
pod 'Google-Mobile-Ads-SDK', '~> 7.13'
pod 'GooglePlayGames', '~> 5.0'
end
hard to say for sure, but this might be a clue: "I've tried pod install manually, building from the .xcworkspace file (which isn't generated by default)".
when you do a pod install, the workspace should be generated. if that's not happening, something is wrong at the pods level.
Oh, when I do pod install
manually, the .xcworkspace
is generated fine. I meant that it isn't generated by default in the Unity build. I suppose there is nothing wrong with that.
The problem is that when I open this .xcworspace
file and build it from there, I get several 'not found' errors. I have also tried to find which files (or classes?) are missing and adding their pods. I reached a point where I was getting a 'not found' error for some files I couldn't find the pods for.
So when you try to build from Xcode does it download both google mobile ads sdk and GooglePlay game?
P.S. Thanks to This conflicting pods problem can be resolved. Try it if it works for you.
Answer by elenzil · Dec 15, 2016 at 05:07 PM
I am using the .xcodeproj to open and build the game, I don't have an .xcworkspace file.
this is your problem. when you do pod install
, it says very clearly that you need to use the workspace, not the project. it's not joking.
The problem is that when I open this .xcworspace file and build it from there, I get several 'not found' errors. I have also tried to find which files (or classes?) are missing and adding their pods. I reached a point where I was getting a 'not found' error for some files I couldn't find the pods for.
those problems need to be fixed. if you're using pods, you need to use the workspace.
I tried working with the .xcodeproj
because the documentation for the play-games-plugin-for-unity reads:
When building for iOS in Unity, a post build step is executed that runs Cocoapods and then adds the required libraries and frameworks directly to the XCode project. This is different from previous versions; you no longer need to open the workspace in XCode.
This, and a couple of YouTube tutorials that build using the .xcodeproj
itself. I'm using the latest release for the plugins, maybe that is causing confusion?
i see. news to me. are you using other cocoapods which are not part of that ? perhaps the problem is mixing old-style and new-style cocoapods ?
After a few failed attempts long ago, I stopped tweaking the Podfile. I just generate the project in Unity and try (and fail) to run it. I am making no changes to the xCode project per se now.
I'm miles past my deadline and am losing business because of this.
Answer by bsoyluoglu · Dec 28, 2016 at 03:13 PM
Hi, I've had the same issue and managed to solve it.
I'm assuming you are trying to run the app on the simulator. The error "Expected in: flat namespace" is given when the library you are using is not available for simulator. Explained here.
So change the player setting for Target SDK under Other Settings to Device SDK, then run the Unity build.
Once you have the xCode project. The project will not build I've no idea why to solve that,
Delete everything that is related to Cocoa Pods Podfile Podfile.lock and Pods folder
Create a clean PodFile (See the example below.) Need to add GoogleSignIn separately since GooglePlayGames is not referencing it correctly. You can read it more here.
run pod install
From other linker flags under Build Settings remove -Obj C
Build xCode project and run it on a real device.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '5.0'
pod 'GoogleSignIn', '4.0.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Your answer
Follow this Question
Related Questions
Unity and Admob using latest Play Services Plugin 7 Answers
Admob Interstitial Ads are not working in IOS, but it is working in Android 0 Answers
Admob calculating banner Ad size 0 Answers
Admob iOS Rewarded Videos don't close 0 Answers
Admob Memory Issues 0 Answers