Adding GooglePlayGames API to Xcode results in multiple architecture i386 errors - ios

So I'm trying to add Google Play Games into my app, but I'm struggling to get their sample code to work. I've seen this issue mentioned a couple times on stack overflow, but I have yet to find a definitive answer.
I'm following the manual instructions listed here:
https://developers.google.com/games/services/ios/quickstart
and adding them to the buttonclicker code here:
https://github.com/playgameservices/ios-basic-samples
What results is a 32 Undefined symbols for architecture i386 errors like the ones below.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GTLCollectionObject", referenced from:
_OBJC_CLASS_$_GTLGamesEventDefinitionListResponse in gpg(GTLGamesEventDefinitionListResponse.o)
_OBJC_CLASS_$_GTLGamesLeaderboardListResponse in gpg(GTLGamesLeaderboardListResponse.o)
_OBJC_CLASS_$_GTLGamesPlayerAchievementListResponse in gpg(GTLGamesPlayerAchievementListResponse.o)
_OBJC_CLASS_$_GTLGamesPlayerEventListResponse in gpg(GTLGamesPlayerEventListResponse.o)
_OBJC_CLASS_$_GTLGamesPlayerLeaderboardScoreListResponse in gpg(GTLGamesPlayerLeaderboardScoreListResponse.o)
_OBJC_CLASS_$_GTLGamesRoomList in gpg(GTLGamesRoomList.o)
_OBJC_CLASS_$_GTLGamesTurnBasedMatchList in gpg(GTLGamesTurnBasedMatchList.o)
...
"_OBJC_CLASS_$_GTLObject", referenced from:
_OBJC_CLASS_$_GTLGamesManagementHiddenPlayer in gpg(GTLGamesManagementHiddenPlayer.o)
_OBJC_CLASS_$_GTLGamesManagementPlayer in gpg(GTLGamesManagementPlayer.o)
_OBJC_CLASS_$_GTLGamesAchievementDefinition in gpg(GTLGamesAchievementDefinition.o)
_OBJC_CLASS_$_GTLGamesAchievementIncrementResponse in gpg(GTLGamesAchievementIncrementResponse.o)
_OBJC_CLASS_$_GTLGamesAchievementSetStepsAtLeastResponse in gpg(GTLGamesAchievementSetStepsAtLeastResponse.o)
_OBJC_CLASS_$_GTLGamesAchievementUpdateResponse in gpg(GTLGamesAchievementUpdateResponse.o)
_OBJC_CLASS_$_GTLGamesCategory in gpg(GTLGamesCategory.o)
I've added the GoogleSignIn.framework, gpg.bunde, and gbg.framework to the project.
I searched for some of these (like GTLCollectionObject) and could not find where it is referenced in the project.
I've tried it on a device, tried removing the 64-bit architecture, and a host of other things, but I'm stuck at 32 errors. What am I missing with this set up?

You need to add the GoogleOpenSource.framework as well.
This is covered in steps 3 and 4 of https://developers.google.com/games/services/ios/quickstart#option_2_manual_installation
Download and extract the latest Google+ iOS SDK from the Google+ Downloads page.
Copy the following items from the Google+ SDK into your project:
GoogleOpenSource.framework
Just out of curiosity, why no use Cocoapods? It does a great job of adding the required frameworks to the project without all the hassle of downloading from multiple sites and then copying them into the project.

Related

I can't build dlib library on xcode

I'm trying to use dlib in ios so I can run an application using face recognition
I'm following this link to build dlib for ios then the error below shows up.
Undefined symbols for architecture arm64:
"_USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_", referenced from:
_dlib_check_consistent_assert_usage in DlibWrapper.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My environment
Mac (OSX) Catalina 10.15.4
SwiftUI (working with)
XCode 11.4
iPhone 6S
IOS 13.4.1
I'm afraid your title is a little misleading. You're not trying to build a library - you've downloaded a precompiled library and are trying to use it in a way it wasn't meant to be used. The library in question was not built for Intel architecture, so it won't run on the simulator. You have a number of options on how to proceed:
You can look for binaries with the appropriate architecture
Find the source code to the library (perhaps in a git project) and compile the libraries yourself
or look into Apple's Machine Learning Libraries and Technologies
https://developer.apple.com/videos/play/wwdc2019/209/
https://developer.apple.com/videos/play/wwdc2018/703/
Check out these and other WWDC videos on machine learning and ARKit as a starter.
I recommend you download Apple's own Developer app from the App Store.
https://apps.apple.com/us/app/apple-developer/id640199958
You can use it to find many videos on available resources.
There are a number of very powerful tools available. It helps if you know python, since that's where a lot of the development work is happening.
Maybe it would help if you were to look into how things are done in the iOS environment so you can better understand how it relates to other platforms.
There are many helpful articles out there, this is the first one I found:
https://towardsdatascience.com/core-machine-learning-for-ios-developers-7f2a4b19ec08
The key is to not get discouraged! There's a lot of useful information out there and it's important to look for alternatives when you've gone down a dead end.
Good Luck! 🍀

Linker Error in iOS (duplicate symbols for architecture x86_64) when running on Xcode simulator

duplicate symbol _llvm.cmdline in:
/Users/inntot/Documents/navigationdrawer 2 2 2 2 2/Pods/GoogleInterchangeUtilities/Frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities(Descriptor.pb.o)
/Users/inntot/Documents/navigationdrawer 2 2 2 2 2/Pods/GoogleSymbolUtilities/Frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)
duplicate symbol _llvm.embedded.module in:
/Users/inntot/Documents/navigationdrawer 2 2 2 2 2/Pods/GoogleInterchangeUtilities/Frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities(Descriptor.pb.o)
/Users/inntot/Documents/navigationdrawer 2 2 2 2 2/Pods/GoogleSymbolUtilities/Frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)
A duplicate symbol error means that somewhere in your project being compiled, something that can only be defined once (like a function, const or class) is being defined twice, and hence the name, duplicated, so the compiler is unsure which definition to use.
However, it is highly likely that this is not a problem with you. These particular symbols, namely _llvm.cmdline and _llvm.embedded.moduleare not generally user-defined symbols and are generally created instead by a framework that you are using, people have encountered this error using frameworks by Twitter and Facebook as well. Looking at the paths to the two files where there are conflicting symbols confirms my suspicion. The errors are being generated in a file in the Google Utils framework.
Firstly, if you made any changes to these google framework files themselves, undo them, as your added or changed code may be the problem.
There are a few fixes that may work for you. The first is that this could be a cocoapods issue. Ensure that you have the default "Debug" and "Release" build configurations in your project, otherwise cocoapods will not handle this well. The next fix that I would suggest is to not include the GoogleInterchangeUtilities framework in the project. GoogleSymbolUtilities was in fact introduced to fix this error cropping up in other google frameworks, so try ONLY including googleSymbolUtilities in your project rather than both symbolutilities and interchangeutilities. Failing that, If there are other versions of these two google frameworks you can download, download a different version, as a fix might have been released or you can find a version before this bug occurred.
If none of these work for you then I would advise getting in touch with google to notify them of this issue, and then sitting tight for a fix.
You can try
Project-> Build Settings-> Enabled bit code (change it From Yes to No) i hope it works for you, if it doesn't please check your pods updated or not or if still your facing problem give some details about issue.

Undefined symbols for x86_64 - iOS - 64-bit transition - Xcode6

I apologise for a dumb question. I really had tough time with this.
I am now, converting my existing code to support 64-bit. My app uses few frameworks
(I use kstenerud/iOS-Universal-Framework)
And I get this error.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MyFrameworkClass", referenced from:
objc-class-ref in MyUI(iPhone_MyVC.o)
MyFrameworkClass is defined in my framework, Which I built using the below settings
In my project, I use this framework and have the same build setting as above.
I am sure, I have the same setting throughout. But still I get this error. Am unsure, what else Am I missing.
You can build the static library for individual architectures and then 'lipo' them together.
Check out the excellent article here: http://blog.diogot.com/blog/2013/09/18/static-libs-with-support-to-ios-5-and-arm64/
You are building your lib for arm only, then you try to run it on x86 (simulator).
Make a lib that supports x86 (64) and use that for debug, the one you have for production.
You should include more of the error message for better help, but it looks as though whatever is providing the MyFrameworkClass class doesn't have a simulator x86_64 slice.
With Xcode 6, you update your project to use Xcode's provided framework target instead of using kstenerud/iOS-Universal-Framework

Sphero with iOS 7

I'm having trouble with Sphero and iOS 7. Like it said to on the quick start guide, since the 1.6 release notes which were supposed to have instructions for starting a new project did not have said instructions, I used the "integrate into an existing project" tab, I set my deployment target to 6.0, brought in all the frameworks, and added the linker settings. When I launch it, I get this error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_RKMCStop", referenced from:
objc-class-ref in RobotKit(RKMacroObject.o)
"_OBJC_CLASS_$_RKMCWaitUntilStop", referenced from:
objc-class-ref in RobotKit(RKMacroObject.o)
objc-class-ref in RobotKit(RKRobotControl+MacroAdditions.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anybody help me? I would appreciate it a lot! Thanks in advance,
Joe
I guess I was wrong in assuming "The examples in this guide were built using Objective-C and have been tested with the current released OS and current version of Xcode" meant that the API was tested for the current version of iOS and Xcode.
Alright, so I was able to reproduce this error in my own project, so that's good. I don't think the problem is specific to iOS 7, but rather to their poor instructions for integration. But, I was able to get something working, so hopefully you can also. But, if you haven't yet really started, your best bet is probably cloning HelloWorld and putting your code in it. Moving on.
The version of the files they in the Frameworks directory appear to have a bug in it, and it's at a level that us developers can't fix. I'm filing an issue on GitHub (will update this later) for their info. Fix Number 1: Use the three files from the HelloWorld/Frameworks directory instead of the top-level frameworks directory.
That will get you building and running, but you'll get an error in your log because you're trying to use an external accessory without declaring permissions on it. So, head over to your Info.plist, and add a key: "Supported external accessory protocols", with item 0 being "com.orbotix.robotprotocol". Worth a thousand words:
From there, you just need to implement the rest of what they show in that sample. Easier said than done. I ended up making a handful of other changes to make my project look more like HelloWorld, but I'm not sure they're necessary. I've uploaded the initial, working state of my project to GitHub if you want to take a look / give it a try. It's here: SpheroSays on GitHub
Good luck!

Anybody have any luck getting FMDB to work with Rubymotion?

I'm trying to get FMDB to work with Rubymotion but every time I try to build the app I get this error:
FMDBTest(master):rake
Build ./build/iPhoneSimulator-5.1-Development
Build vendor/Pods
Link ./build/iPhoneSimulator-5.1-Development/FMDBTest.app/FMDBTest
ld: duplicate symbol _main in ./build/iPhoneSimulator-5.1-Development/objs/main.o and /Users/Bodacious/Apps/FMDBTest/vendor/Pods/build-iPhoneSimulator/libPods.a(fmdb.o) for architecture i386
Here's the app I'm using to test: https://github.com/Bodacious/FMDBTest
Has anybody else got this to work? :/
I don't know RubyMotion, but have had similar problems as I've included FMDB into projects. Bottom line, exclude fmdb.m from your build. It has it's own main() function, which is useful for testing, but it when included in a project, it gives you an error like this. You need the FMDB classes, but not fmdb.m.
I've build an ActiveRecord-like adapter for MotionModel that uses FMBD. As of now, it can be found at https://github.com/aceofspades/MotionModel/commits/sql.

Resources