Xcode 10.2 support with the latest NativeScript? - ios

Building an iOS project after using the default NativeScript Advanced Mac OS instructions does not work.
I have a fresh, new macbook, OSX Mojave 10.14.4, with the latest available Xcode Version 10.2 (10E125).
I followed the NativeScript instructions precisely:
https://docs.nativescript.org/start/ns-setup-os-x
After a few hiccups, I have Android working, but not iOS.
I first started with the issue and solution found here: Swift Version NativeScript
However, after following the steps to downgrade cocoapods from 1.6.0 to 1.5.3, I get errors about Swift 3.0 / 3.1 not being supported and again, a failed build.
After setting up NativeScript using the docs, you see this error:
[!] Unable to determine Swift version for the following pods (for each pod):
- `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (`<my-project>`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
After downgrading cocoapods, you see this error instead (for each pod):
error: SWIFT_VERSION '3.1' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'Socket.IO-Client-Swift')
I also tried opening the project in Xcode. You immediately see the same error from the command line.
Is there any way for the latest Xcode and the default NativeScript setup to work without any further configuration?

The problem is that Xcode 10.2 brings Swift 5 and deprecates Swift 3. Plugins that use outdated Swift code won't work.
Solution 1: Downgrade to Xcode 10.1.
Solution 2: Update the nativescript plugins that use Swift 3 pods.
Update to the latest nativescript-vue-devtools
npm uninstall nativescript-vue-devtools
npm install --save nativescript-vue-devtools
Replace the packages nativescript-socket.io with nativescript-socketio:
npm uninstall nativescript-socket.io
npm install --save nativescript-socketio
Replace the packages nativescript-toast with nativescript-toasty:
npm uninstall nativescript-toast
npm install --save nativescript-toasty

Related

Installing Cocoapods broke previously installed packages

I am making a swift project and I decided to install Cocoapods in order to access functionality I did no have access to before. I had the firebase-ios-sdk packages installed prior to adding Cocoapods to the project. I am opening the project using the xcworkspace created by Cocoapods, and the packages that were working previously are now not working. The main error I am getting is: Missing package product "name". I am getting this error for all of the packages installed with the firebase-ios-sdk. I have attached an image of an example of just one of the errors. Can anyone assist with this issue? I am on Xcode 13.4.1, M1 Air with 12.4 Monterey, and cocoapods 1.11.3 installed.

Swift Snapshot for version 4.1

I'm new to iOS development, so thank you in advance for the help. I'm trying to build an application that was built in XCode 9.3 and Swift 4.1. When I install the packages using Carthage, it throws this error:
"Skipped installing CryptoSwift.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.1 (swiftlang-902.0.48 clang-902.0.37.1) and the local version is 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)."
The reason for the error (very clear...) is because I'm trying to build the project using XCode 10.2 and Swift version 5.0.1. So in order to fix it, you need to go to the swifts snapshots and download the version I need and install it.
However, when I go to the swifts snapshots I see the one for 4.1 but the links seem to be broken(?). It redirects me to the apple Xcode documentation.
Does anyone know where and how can I install the swift version I need?
Thanks,
If I understand your problem right, try giving this a go(if not already):
When using a newly released version of Xcode you'll have to build
libraries from source (by passing --no-use-binaries to carthage
update) until a new version of framework comes out which has pre-built
binaries for that Xcode version.
The above is an extract from: https://github.com/realm/realm-cocoa/issues/6134 and it might help...

How to install older version on carthage

I need to have carthage for running Appium tests.
While Appium community is still working on supporting XCode9.2, we need to rely on XCode 8.3.3
OS: MacOS High Sierria
XCode version: XCode 8.3.3
Java: 1.9
But when I run command brew install carthage, I am getting below error:
Error: Your Xcode (8.3.3) is too outdated.
Please refer below link, which implies that- XCode9 support for Appium is not yet rolled-out
[https://github.com/facebook/WebDriverAgent/issues/639][1]
Kindly suggest work around in meanwhile.
Thanks
1) First of all be sure to remove everything:
brew uninstall --force carthage
2) Then search the commit that you like from here:
https://github.com/Homebrew/homebrew-core/search?p=2&q=carthage&type=Commits&utf8=✓
3) in your case might be this:
https://github.com/Homebrew/homebrew-core/commit/f74d9ba598c9843552450abeb382cacd0e71d4c0
the one related to Carthage v0.24, which should be compatible with your requirement of working with Xcode 8.3.3.
4) then get the commit identifier f74d9ba598c9843552450abeb382cacd0e71d4c0 and run:
brew install https://github.com/Homebrew/homebrew-core/raw/f74d9ba598c9843552450abeb382cacd0e71d4c0/Formula/carthage.rb
I was having the same problem, but was unable to use brew install. I kept getting a 404 error when trying to do it.
To get an old version I cloned the Carthage project from the repo, changed my working copy to the specified version tag I needed and ran make install. This worked :D

Carthage update is failing with error 'could not posix spawn 35'

I have an application which was developed in Xcode 7.3 and Swift 2. Now I am trying to convert it to Swift 3.0.2, as the dependency manager I am using is Carthage. Now I am updating my Carthage so that all the frameworks should support swift 3.0.2. For this, first I have used the following command:
"carthage update --platform iOS"
It now fetches all the dependencies and check out all the dependencies but then after checkout it starts to build the dependencies and while building the dependency it just fails with an error.
Here is a attached screenshot of the error. I am totally blank on what I am missing in this case:
When I faced the problem , this is how I resolved it:
I deleted everything that was checked out and got all new fetches and builds
Ran carthage update --no-build && carthage bootstrap
This problem mainly occurs in Xcode 7.3 beta2 (7D129n) toolchain. Carthage version0.12 will build the cartfile successfully if you set xcselect to 7.2.1.
Version v0.11 didn't have this problem. The problem occurs during the build, maybe because all the versions of Carthage dependencies don't match too. I also read a few posts which asked me to supply with sudo carthage update --platform iOS --no-use-binaries.
And you're using a really old version of Xcode. I'll suggest you to upgrade.

Xcode 7 and cocoaPods problems

Im currently working on Xcode 7 i have a project that includes cocoapods.
When i pulled my Git latest version (a working version) it said
" file not found"
to fix this i ran in the Terminal "pod install" I'm also using AWSIOSSdk
version 2.0.15 (an older version) in my app now when i try to run it it says
"[!] Unable to satisfy the following requirements:
XMLDictionary (~> 1.4.0) required by AWSiOSSDKv2 (2.0.15)
"
i cannot update my AWS sdk it causes me more problems plus I'm unable to locate my podFile.lock it was removed from the folder.
How can i solve these issues I'm currently running on the latest CocoaPods version tried to uninstall and reinstall cocoapods still same issue.
Thanks to anyone who helps.
AWS has changed their FW it appears that they are not using the XMLDictionary FW and other FW as well anymore if you will try to update the AWS FW please note that you will have to change your methods names and import statements (BFTask is now AWSTask for example).

Resources