Using the Google+ API with xCode/iOS (ARC) - ios

I want access to my Google+-Timeline for an iOS-App.
Following the Google-Documentation I imported the libGTlTouchStaticLib.a and library's header files.
After trying to build the project the following warning/error occured:
ld: warning: ignoring file ..../libGTLTouchStaticLib.a, file was built for archive which is not the architecture being linked (i386)
How do I build the Lib for xCode 4.3.2 architecture?

what does the command: file libGTLTouchStaticLib.a return? It sounds like it's compiled for ARM (the device) and you are running it in the simulator (i386). YOu might also want to try it on a device.

Related

Unable to build HERE SDK Premium for ios-arm64-simulator

Having trouble building HERE SDK for iOS (Premium 3.19) for an ios-arm64-simulator. The error produced by Xcode 13 on an M1 pro processor is:
ld: building for iOS Simulator, but linking in dylib built for iOS, file 'Pods/HEREMaps/framework/NMAKit.xcframework/ios-arm64/NMAKit.framework/NMAKit'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After some research and testing it looks like HERE SDK's XCFramework folder as well as the Cocoapod configuration only include ios-arm64 and ios-x86_64-simulator. It looks like the podspec is attempting to fix this by overriding the target app's iOS simulator excluded architectures (adding excluded architecture "arm64"). This likely works fine in cases where only Cocoapod sourced libraries that include x86_64 are used in the target app. However, it's a problem when using libraries from other sources where there is no roll back option to x86_64 simulators (e.g. Swift Package Manager).
Is there a way to use lipo to generate ios-arm64-simulator from the two existing framework builds? Or is this something where ios-arm64-simulator needs to be built as another configuration from the HERE SDK source?
Let me tell you that we have already located this situation in the SDK and our team in charge of the SDK is working very hard to provide a solution to this problem in the next release of HERE SDK Premium.

When publishing a project (swift 4.2) in the AppStore, an error occurs when linking the libPrinterSDK library.a

All kind time of day. The project on Swift uses the SDK for blueTouth printer Mini Thermal Printer POS-5805DD. The libPrinterSDK library (included with the printer) has been added to the root of the project.a and the PrinterSDK header file.h, header-file is connected via bridge, when you run the project on a real device-everything works correctly, no errors occur. But when you try to build a project to upload to the AppStore, at the very end when linovke libprintersdk library.a an error appears:
ld: bitcode bundle could not be generated because
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a
(GCDAsyncSocket.o)' was built without full bitcode. All object files
and libraries for bitcode must be generated from Xcode Archive or
Install build file
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a' for
architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If there is any experience of building a project with libPrinterSDK files.a and PrinterSDK.h, I would really appreciate any help. Thanks.
Im not sure your project has turn Enable Bitcode off yet, if not, try to set No like this image below and Archive project again.
If it doesn't work, you can refer here

Custom framework fails to load in iOS simulator (wrong architecture)

I'm trying to build a Cocoa Touch Framework for iOS8 which will eventually be embedded in apps and submitted to the App store so it's important that the release build contains ONLY armv7 but the debug build must run in the simulator too. As such, I've been following this tutorial and I'm hitting upon a runtime error when trying to run an application in the simulator with the framework embedded:
dyld: Library not loaded: #rpath/TestFramework.framework/TestFramework
Referenced from: /Users/jay/Library/Developer/CoreSimulator/Devices/97715157-EABB-4F38-8CA0-62768358DDD6/data/Containers/Bundle/Application/4856FC75-6C5B-4F7E-91A9-70CA1863D130/Test.app/TestFramework
Reason: no suitable image found. Did find: /Users/jay/Library/Developer/CoreSimulator/Devices/97715157-EABB-4F38-8CA0-62768358DDD6/data/Containers/Bundle/Application/4856FC75-6C5B-4F7E-91A9-70CA1863D130/Test.app/Frameworks/TestFramework.framework/TestFramework: mach-o, but wrong architecture
However, when I browse to the framework binary it's complaining about
(/Users/jay/Library/Developer/CoreSimulator/Devices/97715157-EABB-4F38-8CA0-62768358DDD6/data/Containers/Bundle/Application/4856FC75-6C5B-4F7E-91A9-70CA1863D130/Test.app/)
and run xcrun lipo -info TestFramework I get the output Non-fat file: TestFramework is architecture: i386 so I'm kinda lost at where to go now. It runs fine on an actual iOS device.
Based on the question and your comments, the most likely cause of this is that you are building your framework for 32bit and linking it into a 64bit application. If that's not the case, please provide the entire text of your crash log.
You should build your framework 4way-fat:
i386/iphonesimulator
x86_64/iphonesimulator
armv7/iphoneos
arm64/iphoneos
In order to make it 4-way fat, you'll need to manually lipo-together your i386/x86_64 sim build with your armv7/arm64 device build. Building 4-way fat with two different (from Xcode's perspective) platforms is not supported by Xcode.
New in Xcode 11: You can use an xcframework to support these kinds of scenarios! No more lipo hacks required. You can find the details in WWDC 2019 Session 416
In my case, I was using a custom framework containing views that I use in the Interface Builder and I got this error on the Interface Builder build phase.
Running pod install fixed it.

file was built for arm64 which is not the architecture being linked (x86_64)

I am building a framework first to use in my ios simulator. However I get this error when importing it into the main project:
file was built for arm64 which is not the architecture being linked
(x86_64)
Here is the build info of my framework:
UPDATE:
I created a universal framework using this technique: https://medium.com/#syshen/create-an-ios-universal-framework-148eb130a46c but I'm still getting the error
UPDATE: Results from running file on the binary:
hunterp$ file dinkle
dinkle: Mach-O universal binary with 2 architectures
dinkle (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
dinkle (for architecture arm64): Mach-O 64-bit dynamically linked shared library
I was incorrectly copying the binary framework and using an old one from before I changed it into a universal.
To create framework and convert .h file into .a fat file. Compile your project with simulator target and device target ,after these two tasks you have to join to make universal file with shell.

How to access framework search path?

I am new to iPhone development and to XCode. I'm getting ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386 when I try and run my project on a simulator. I've tried linking frameworks in my XCode project, but I can't see them added to the framework search path, only as in the screenshot below:
http://i.imgur.com/HrPmZOC.png
Check your Build Phases -> Linked Binary With Libraries of your MyProjectTests. They can be found here:

Resources