cannot build project with xcode 8 beta 6 - ios

I am getting following error after I add a library via carthage -
library name compiled with older version of Swift language (2.0)
than previous files (3.0) for architecture x86_64
I have tried it with Argo library. (https://github.com/thoughtbot/Argo)
I have selected the correct xcode version using xcode-select utility.
What could be the problem? Any help is greatly appreciated
Thanks!

From what I learned, looks like you can't have libraries written in different versions of Swift.
In my Obj-C project I had 2 libs installed with CocoaPods
I updated the first one using the swift3 branch on github, and I converted the second one with Xcode.
Everything is building properly now!

This is happening as you've included another library (via cocoa pods or by linking the library directly etc...) which is compiled (or being compiled) in swift 2.
I've seen this a lot with Cocoapods (and Carthage)

Related

Facing problem regarding SwiftSocket library version in Projects in Xcode. How to mitigate the problem?

I am trying to utilise the library SwiftSocket. I have followed the steps given in:
https://learnappmaking.com/cocoapods-playground-how-to/
Then I open the project by clicking on Garbage management.xcworkspace. I get the following message:
How to solve this issue? (My present installed Swift version is 5.1)
This SwiftSocket Library was compiled in swift 3.x
And new Xcode versions no longer to support swift 3.
I suggest you to use this Library.It is well compiled with latest swift version.
https://github.com/socketio/socket.io-client-swift
Add
pod 'Socket.IO-Client-Swift'
to your pod file.

Undefined symbols for architecture x86_64: xcode 9 Swift 4

I create app that uses Huawei SDK written in Objc with updated docs in Oct 2017. But when I add framework to project, this shows me stange error. I have stack on this problem couple days, I have tried everything from similar problems, but nothing helped for me.
Framework added correctly(header file, link binary with libraries) autocomplition works well and shows the methods when trying to use SDK.
Already tried: change/edit/update
Valid architecture: arm, armv, armv7, armv7s, i386, x64_86
Clean Derived date and achieves
Restart OS
Change swift version: Shows another error
Checked ObjC bridging header
Pod update/install
Framework search path
SOLUTION:
Launch on real device=)
Looks like your HWMobileSDK.framework is not a fat framework. You'll either need to find a fat framework, or a second build of the framework that's compiled for the simulator (x86_64). I couldn't find any reference to that framework online, so it looks like it's not publicly available. If you got this from Huawei directly, you should ask the person you're in contact with there. Either they don't provide a version of the library for the simulator and you'll need to develop using a device only, or you need another version of the library.

RealmSwift: Module Compiled with Swift 3.0 cannot be imported with Swift 3.0.2

I am trying to use RealmSwift with my Xcode project. I have used it several times before, but since the last Xcode (8.2) update I keep getting the same error "Module compiled with Swift 3.0 cannot be imported in Swift 3.0.2".
I have tried installing it through cocoapods and I have tried installing it directly. I have tried changing the IOS. I have updated the pods and downloaded the latest version, but nothing is working.
I looked at similar issues posted on here with no luck:
Realm's Swift module compiled with Swift 3.0 cannot be imported in Swift 3.0.1
Module compiled with Swift 3.0 cannot be imported in Swift 2.3
Migrating from Swift 2.3 to Swift 3 with dependencies
Any advice would be appreciated.
You can download the Swift 3.0.0 toolchain as a temporary workaround until the 3rd party framework has been updated to the latest version. Swift 3.0.0 is available here:
https://swift.org/download/
After downloading it, you can choose to use Swift 3.0.0 from the menubar:
Thought this might help anyone facing the same with other 3rd party frameworks that haven't yet been updated.
Add Realm.framework in Build Phases by using + -> New Copy File Phase. Follow the image below.
And import 'Realm/Realm.h" in ProjectName-Bridging-Header.h file.
Swift binaries aren't compatible across different versions. Swift 3.0 and Swift 3.0.2. although virtually identical are still different binaries.
We try to push out new builds of Realm Swift to support new versions of Xcode as soon as possible. At the time of writing, we're now shipping 3.0.2 binaries of Realm Swift.
So as long as you've updated to the latest version of Realm Swift, this shouldn't be a problem anymore: https://realm.io/docs/swift/latest/#getting-started

Issue with building project after addition of AFNetworking in Xcode 8

I just added AFNetworking in my project and have this problem.If you will say that I need to add a security.framework I will answer that I did it already.Here is screenshots. Problem screenshot
I have already added framework screenshot
On screenshot I see that you added Apple Security.framework, and problem is with AFNetworking framework. Are you sure that you added AFNetworking to your project. If it was also added - then next question comes:
Was CocoaPods used for this, or there was another source. CocoaPods should install newest version of framework but if framework is for example copied from older project - then it can cause many issues. For example framework may not support arm64 architecture.
So first attempt to solve this problem will be using fresh version of framework (using CocoaPods recommended), eventually check architectures supported by framework (see here).
Clean your build folder and run pod install.

Polidea ios-class-guard is DEAD in XCode 7, replace it or fix it?

Everything is great before XCode 7 and iOS 9. After we upgrade XCode to 7.0 and 7.0.1, the ios-class-guard keep annoying us.
You can't install ios-class-guard based on the official tutorial. The homebrew is failed to install formula.
The following build commands failed:
CompileC /Users/Digiflex/Library/Developer/Xcode/DerivedData/ios-class-guard-afpnixzupjudctebfxyqptpmbgpa/Build/Intermediates/ios-class-guard.build/Release/MachObjC.build/Objects-normal/x86_64/CDLCSegment.o Source/CDLCSegment.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Then, we download source code from Polidea/ios-class-guard. After we fixed couple bugs, and compiled it. We archived build and export to
/usr/bin/ios-class-guard
When we do the obfuscation, it looks OK. But when we run project in XCode 7, we got many errors like:
Unexpected '#' in program
or
Missing context for method declaration
After many hours research with no conclusion, our question are:
How to fix the ios-class-guard problem by myself, under XCode 7 environment?
Is there any other open source project provide a similar feature, which is can obfuscate Class, Method and String?
There is new version (0.8) of iOS Class Guard with Xcode 7 support.
I succeeded to fix errors like this by replacing
#import <Foundation/Foundation.h>
with:
#import UIKit;
In my project .pch file.
Then I also changed in my project build settings:
Enable modules (C and objective C) to YES
However I end up having the same problem for imports of classes in the .pch file:
#import "BDError.h"
The latest version of iOS Class Guard (0.8, as of this writing) still has issues with Xcode 7.3, and didn't fully fix support for prior versions of Xcode 7.
How to fix the ios-class-guard problem by myself, under XCode 7 environment?
Starting with Xcode 7, the iPhoneOS SDK that ships with Xcode does not include the ARM-based .dylib dynamic-library files anymore, and these have been replaced .tdb files. The .tbd files appear to be markup (text) files describing their corresponding .dylib files, specifically including at least some of the symbols. The errors you see are because of this change.
The consequence of this is that in order to obfuscate an ARM-based build, the symbols to exclude can only be found by examining the iPhone simulator libraries. Currently, this implies that an x86/x86_64 build must be created for the analyze phase of building.
According to "apple staff":
"For those who are curious, the .tbd files are new 'text-based stub libraries', that provide a much more compact version of the stub libraries for use in the SDK, and help to significantly reduce its download size."
These .tbd files do not contain all the necessary symbols, for automatically finding excludes, though.
iOS Class Guard 0.8 fixed the error messages, but in such a way that it wasn't finding all the symbols that should be excluded.
Is there any other open source project provide a similar feature, which is can obfuscate Class, Method and String?
Yes, PPiOS-Rename is a fork of ios-class-guard that fixes this issue, by always searching for symbols in the iPhoneSimulator SDK, even if the build was compiled for a device. It has also been updated to work with Xcode 7.3. (Full disclosure: I work for PreEmptive Solutions who created this fork, but it is open source and free.)

Resources