Bluemix Swift Mobile Client Access SDK when imported says no such module BMS Core and BMS Analytics show 35 errors due to which my build fails - swift

As per the instructions given on Bluemix site; I installed the Swift SDK
pod use_frameworks!
pod 'BMSSecurity'
and it shows this on my terminal:
Then, when I built the project, I got 36 build errors.
First of which is "no such module as BMSCore" when I can see that framework imported in the pod and 35 errors related to BMSAnalytics, which is again framework imported.

These build errors are due to the incompatibility between two of the BMSSecurity dependencies (BMSCore and BMSAnalyticsAPI) and the version of Xcode you are using (7.2.1). The latest versions of these 2 frameworks only support Xcode 7.3 and higher, as explained in the BMSCore Github README. If you want to continue using Xcode 7.2, you can use BMSCore 1.0.3 instead.
So, there are 2 possible solutions here:
Upgrade Xcode to version 7.3
Add the following line to your Podfile: pod 'BMSCore', '~> 1.0.3'
Option 1 is recommended since only Xcode 7.3+ will be supported in future releases of BMSSecurity.

Are you opening FoodTracker.xcworkspace ?? please open .xcworkspace after pod install..

Related

XCode 14 - Minimum deployment target for SPM package

I am actually compiling for macOS 10.12, as stated. I import the Reachability.swift package, that is compatible down to 10.9. No minimum version is indicated within the Package.swift file. However, I get this error while compiling :
Compiling for macOS 10.12, but module 'Reachability' has a minimum
deployment target of macOS 10.13
It happens since I updated to XCode 14, with version 13, there was no problem.
If I specify the minimum version in the Package.swift of Reachability platforms:[.macOS(.v10_10)],, I clean all the caches, I get the same problem.
I could probably upgrade deployment target to 10.13 (same computer compatibility) or simply include the Reachability.swift file in my code, but I would rather that it works...
[EDIT] Note : other packages, like AppCenter, do not have the same problem… which is weird.
[EDIT 2] With the release of XCode 14.1, the problem remains the same.
Do you have any suggestion ?
I can reproduce your problem: Using AppCenter is OK, but the reachability throws an error.
Here is what I found and maybe this is the root cause:
Make Reachability a local SPM, and modify its swift-tool-version settings and platform settings to align with AppCenter.
Then if you click into the .v10_12 MacOSVersion, you will find os versions lower than 10.13 has all been marked as unsupported
If you head to the built files, test it with otool, you will find the built product's minimum supported version matches with the above description:
So even if you specify the minimum support version to 10.12, the build tools will still target 10.13.
If you check LC_MIN_VERSION_MACOSX on AppCenter. It is also targeting 10.13 instead of 10.12 in its package.swift file.
But why Xcode accepts AppCenter and raise an error for Reachability?
Check the build log below. You will find it in the emitting module stage, the build system is using swift-frontend to embed those 3rd party dependencies. So I guess since the AppCenter is written in objective C.
The checking minimum os version behavior of swift-frontend is different between OC Dependency "AppCenter" and Swift Dependency "Reachability."

Illegal Instruction 4 error while running the unit tests on Xcode

I recently updated to Xcode 12.3 and did the workaround to run the carthage dependencies. The build is fine but when I run the tests, I get the Illegal Instruction 4 error. I assume that the arm architecture issue causes that issue. I use Quick and Nimble coming from carthage and these are used in testing. I have tried setting the excluding archs and validate archs to yes but none of them worked.
I cannot move the libraries from carthage to pods or spm because there are so many configurations in the libraries. Updating to a new Xcode version is such a pain especially if you are using carthage.
UPDATE:
I downloaded the carthage version of 0.37 and implemented the xcframeworks into the project. To run the dependencies for xcframeworks, I run the following command:
carthage bootstrap --use-xcframeworks --no-use-binaries --platform ios
If you can use Carthage 0.37.0 and are able to use XCFrameworks, then this answer might be valuable for you đź‘Ť In this vesion they added support for XCFrameworks and I find it quite nice to use. Especially since this popular workaround can finally be removed again.

producing flutter (Xcode) testflight archive fails with multiple commands produce

need to produce an archive so we can upload to TestFlight so followed instructions in https://flutter.dev/docs/deployment/ios . my flutter runs on both real iPhone and simulator with no problem. so I produce a release version as required then open the resultant Xcode project (runner). immediately see the error
:-1: Multiple commands produce '/Users/jmcfet/Library/Developer/Xcode/DerivedData/Runner-cwxykfeiijpirmgbtrkzktdrahbt/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/jmcfet/AndroidStudioProjects/sis/ios/Flutter/Flutter.framework' to '/Users/jmcfet/Library/Developer/Xcode/DerivedData/Runner-cwxykfeiijpirmgbtrkzktdrahbt/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
now this does not happen when I do the same against the "Flutter Hello world" app so wondering what is messed up in my Flutter app
no luck :
johns-MacBook-Air:ios jmcfet$ pod install
Analyzing dependencies
Fetching podspec for Flutter from .symlinks/flutter/ios
Fetching podspec for video_player from .symlinks/plugins/video_player/ios
Downloading dependencies
Using Flutter (1.0.0)
Using video_player (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
[!] Automatically assigning platform ios with version 8.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target Runner to Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig).
not an IOS expert but looks like the install was not successful. little confused as the Xcode project was generated by Flutter so why is Flutter generating a bad config file. if so looks like a bug to me

Swift Version 5, SwiftyJSON

Build system information
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'SwiftyJSON')
how can I deal with it?
SwiftyJSON v4.3.0 supports Swift 5. Check your Podfile to make sure you’re getting the latest release. You may need to update your Pods (with pod update) to make sure you’ve got the latest versions.
Also, you might consider retiring SwiftyJSON and using JSONEncoder/JSONDecoder instead. See Encoding and Decoding Custom Types or the Using JSON with Custom Types sample for more information.
If, on the other hand, you are not using Swift 5 yet, just configure your Podfile indicate that you want to use SwiftyJSON v4.2.0. E.g.
target 'MyApp' do
pod 'SwiftyJSON', '~> 4.2'
end
Either change the build target of your project to Swift 4.x or wait until the project gets support for Swift 5 (you can check that on the GitHub page)
I get this error too when i tried to pod lint or push.
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2.
I have to stay on xcode 10.1 ans use cocoapods 1.5.3, but on a fresh install (new mac) I received the same error.
Here is my solution:
After comparing my 'gem list' with an other mac, I found that the gem xcodeproj was very high (1.12.0).
So, I installed a lower version required by cocoapods (1.5.3)
"sudo gem install xcodeproj -v 1.5.7"
and remove the never
"sudo gem uninstall xcodeproj -v 1.12.0"
Wrongs fine now, I cant lint and push my pods.

Alamofire not working well with swift 3

I have a project written by swift 2.
I updated to swift 3, I'm using Alamofire and swiftyjson
so I updated their by cocoapods and I fixed all my project issues,
after all that I got this error about Alamofire
The following binaries use incompatible versions of Swift:
also I have these warnings
this is my pod file
this what I see in terminal after pod update
Update all pods
Updating local specs repositories
CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1
Analyzing dependencies
Downloading dependencies
Using Alamofire (4.0.1)
Using DropDown (2)
Using SideMenu (2.0.5)
Using SwiftyJSON (3.1.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 4 dependencies from the Podfile and 4 total pods installed.
[!] The `ehtamiApp [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-ehtamiApp/Pods-ehtamiApp.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `ehtamiApp [Release]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-ehtamiApp/Pods-ehtamiApp.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
what is that mean? and how I can fix it?