Skipped installing .framework binary due to the error - ios

I'm using Carthage and getting this error with a dependency or two:
Skipped installing mixpanel-swift.framework binary due to the error: "Incompatible Swift version - framework was built with 3.1 and the local version is 4.0."
I understand generally what Carthage is seeing as the problem, but I haven't found a satisfactory answer on my own or looking through other issues posted that feels as clean or solid as I'm assuming it should be.
I've seen carthage bootstrap --platform iOS --no-use-binaries as a potential solution, but I can't tell if thats solving the actual problem I'm having or not, or if it is the best solution long term?
Any help on a solution or guiding me to my way there? Thanks!

To solve this you need to use the Swift 4 version of Mixpanel. It is failing because the code you are getting from Github is for Swift 3. On their Github page they say you should use the Swift 4 branch - Mixpanel Swift 4 branch. I think your Cart file needs to use: github "mixpanel/mixpanel-swift" "swift4"

Related

Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.3 compiler

Check several publications with the same compilation error, and it really seems annoying that some libraries do not have support for current versions, well Apple also updates the Xcode many times along with the Swift version. Then after reviewing many publications and research, I discovered this post where they indicate:
Swift 5 provides binary compatibility for applications: a guarantee
that, in the future, an application created with one version of the
Swift compiler will be able to communicate with a library built with
another version. This applies even when using the version
compatibility mode from previous languages ​​(-swift-version 4.2).
In other cases, they indicate using carthage update --platform iOS --no-use-binaries but I am using cocoapod so I cannot use that solution and finally indicate enabling Build Libraries For Distribution, but nothing really worked for me until now and I can't help thinking that maybe tomorrow they will launch swift 5.1.4 and the support they make for swift 5.1.3 is unusable.
I really hope you can help me with the solution to the problem I present with the compilation error and if anyone knows about the post ABI STABILITY

How to compile `.framework` file?

I searched through existing Stackoverflow questions related to this problem but didn't find any help to solve it.
So here's the problem:
I am trying to integrate .framework file into the project but it's giving me an error saying that module compiles with 4.0.3 can't be imported by swift 5.0 compiler.
I wanted to know how to compile that.framework file? so that it will become compilable to swift 5.0
Please help if you come across such a problem.
Note: .framework file is created by a third-party developer
If the framework you're trying to integrate is binary only, then your best option is to check with the 3rd party developer regarding their support for Swift 5.0.
In case there are sources available, you can try checking if there is any work being done in their repository (usually a separate branch), or you can try forking the sources yourself.
Note that with the source option, you'll have access to possibly unstable and untested code, and depending on the experience I'd be very careful in this case.

Convert to Current Swift Syntax Failed - "No such module" (Swift 4, Xcode 9)

In Xcode 9, I am trying to do the automatic conversion to Swift 4.
It fails with the following message:
Convert to Current Swift Syntax Failed
Please ensure that all selected targets build successfully with the currently configured Swift version before attempting a migration.
It's complaining of a missing module. But when I do a regular build there are no issues. Not sure if this is relevant, but the module (which Xcode is complaining is missing) was already converted to Swift 4 earlier (in it's own project).
Note: No Cocoapods / Carthage used here.
Note: Two solutions tried (and worked) but do not address the underlying issue.
One solution is to do the conversion manually (change Swift version to 4 in build setting and apply Fix-Its one by one until no more build errors).
Another solution is to disable the third party framework (comment out all code where it's used), do the auto-migration, and then re-enable the framework. This could get pretty difficult with bigger projects.
I can't find any solution yet.
For now I fix manually setting Swift Language Version
After changing from 3.2 to 4.0 I compile and fix errors and warnings manually.
I'm waiting for a better solution!
I also got this problem while converting my project to Swift 4.0. Looks like problem appears when you try to convert target which imports a framework which is already in Swift 4.0. At your screenshot you try to convert 'RecipeTextParser' which imports 'SovaTools' which is already Swift 4.0.
I found dirty, but working solution. You can use older(Swift 3.2) version of 'SovaTools' when converting. You should NOT check it's mark in target selection window of conversion tool. Then, when 'RecipeTextParser' will be successfully converted you can use Swift 4.0 'SovaTools' version again.
I got this error and in my case one of my Pods(the one Xcode was complaining about) was a Swift 4 target and the rest were Swift 3.2. Looking at the build logs it looks like Xcode built that framework in one location and was searching for it in another. When I reverted that Pod to an older version(that used Swift3.2) the problem went away. Obviously a Xcode bug. HTH
Just update your pod and it will resolve the issue.
To update pod:
open terminal and go to your project directory
type pod update
This resolved my issue.
Xcode (Xcode 9) language migration feature is not as much accurate that it can migrate your complete code/project from one swift version to another with zero tolerance. It skips few code migration for us (developers). It may be bug or inaccuracy of tool. But you need to put some manual effort also, to completely migrate swift language version for your project/code.
Now, according to your snapshot, Xcode is showing and error for 'RecipeTextParser' framework. I think this is an external/third party framework. Another point to note, you've integrated this framework using CocoaPods:
Any one of following can be reason for failure of code migration:
CocoaPods locks framework (files) for editing. So language migration process may not be able to migrate (or identify) code for external/thirdparty framework.
In general terms, Framework is package of code files, so framework itself may not allow file/source code editing.
Suggestion as solution:
Update your cocoa pods as well as all frameworks integrated using cocoa pods compatible to latest swift language version.
If you've manually integrated/added external/third party frameworks, then you need to update/replace those also.
Some manual effort is required to completely migrate code between swift languages. I tried swift migration with above options and my all projects are now compatible with swift 4.

AFNetworking Not Working with Xcode 5.1.1 and Cocoapods - Redefinition Issues

I have a project I which I need to use AFNetworking so after downloading the source files, importing them manually and struggling for hours with no luck I figured I'd use Cocoapods as it should surely be easier. Unfortunately not, I'm now getting lots of issues regarding redefinition of Enumerators, Duplicate interface definition and property has a previous declaration.
If anyone can help me with why I could be getting this and how I can get rid of the error it would be much appreciated. I was under the impression it is meant to be easy using Cocoapods but as of yet I haven't seen that!

Unity Google Play Games Plugin Won't Compile in Xcode iOS

Whenever I try to compile my Unity game in Xcode I get a 3 compile errors which are coming from the Unity Google Play Games plugin:
GPGSAchOrLbDelegate.h - Lexical or Preprocessor Issue 'GooglePlayGames/GooglePlayGames.h' file not found
GPGSRealTimeRoomDelegate.h - Lexical or Preprocessor Issue 'GooglePlayGames/GooglePlayGames.h' file not found
GPGSManager.h - Lexical or Preprocessor Issue 'GooglePlus/GooglePlayGames.h' file not found
I've no idea why this is happening, I followed all the setup instructions correctly.
Any help would be greatly appreciated!
one gotchya is they recently changed many of the method names in the library, in a recent update...
it's possible this has caught you out?
It's very hard to resolve this, but I found some discussion about this for example here,
http://answers.unity3d.com/questions/679424/google-play-games-plugin-for-unity-not-authenticat.html
it's a bit easier on iOS than Android.
Alternately: note that, essentially, you have not included the GooglePlayGames.h file. Include the link to "which" instructions you were following, to guess which step is problematic. (Most Unity plugins - like Prime31 - have a "preprocessor" stage that does that for you or in the case of Android fills in the damned manifest. Something is going wrong at that stage.)
I actually solved this myself by removing the plugin and starting afresh, and then starting a completely new xcode project rather than appending to an old one.
Irritating and time consuming but I got there in the end!

Resources