iOS carthage with MQTT framework - ios

I have a application which is written in objective c and using pods to set dependency and target iOS version is 7.0. Due to some license conflict i want to use MQTT with dynamic linking with help of Carthage. So I followed following steps
Remove pod 'MQTTClient' from pod file and run the pod update.
It removed MQTTClient and keep others pods intact like afnetworking etc.
then I create Cartfile in project directory.
Add Github "ckrey/MQTT-Client-Framework" in Cartfile.
Run command carthage bootstrap --no-build --platform "iOS"
then run carthage build --no-skip-current --platform "iOS" gives always error Skipped building project due to the error:
Dependency "project" has no shared framework schemes for any
of the platforms: iOS
I have following question
Q1 As I understand, we can use both Carthage and cocoapod in same project.
Q2 how to resolve error mention in step6.

You can use Cocoapods and Carthage in the same project.
On step #6 make sure you are specifying the download as a 'binary'

Related

Framework not found MapboxCommon.xcframework iOS Xcode

I want to use MapBox Search SDK for iOS. So I've followed this official documentation
Firstly, I've created ".netrc" in my /home directory as instruction and then add this -
use_frameworks!
target "TargetNameForYourApp" do
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
to podfile. Then run pod install and got this in terminal -
Analyzing dependencies
Downloading dependencies
Installing MapboxCommon (9.0.2)
Installing MapboxMobileEvents (0.10.8)
Installing MapboxSearch (1.0.0-beta.4)
Installing MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MapBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MapBox` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
But after running all this I'm getting this error in Xcode -
Framework not found MapboxCommon.xcframework
I've also tried this -
pod deintegrate && pod cache clean --all
pod install
but still the same error.
I think I've followed correctly the documentation and entered the secret API Key correctly. So why am I getting this error?
Edit:
In Project Targets the installed pods are not listed -
But In pod folder in Project directory -
there are other frameworks available which are not available in Xcode Pods Target.
Is that the pointing that the frameworks are not available in the projects?
Edit:
I've checked in my project directory if the Mapbox.common.xcfreamework present or not. And I found that file under pod/mapboxCommon folder
I've been opening my project using MapBox.xcworkspace which file was generated after running pod install.
You are facing this error because you are still trying to build the project file (xcodeproj), not the generated workspace by CocoaPods.
To resolve this issue, open up 'MapBox.xcworkspace' file and use that file to access your projects from now on.

Can't add Mapbox and MapboxNavigation SDK

In order to implement Mapbox SDK, according to official docs (https://docs.mapbox.com/ios/maps/overview/#install-the-maps-sdk,
https://docs.mapbox.com/ios/navigation/overview/), adding Mapbox-iOS-SDK and MapboxNavigation through Cocoapods, always get error, shown bellow.
I thought this is related to the usage of sourcery or SwiftGen which are the parts of project or something else, but this happened on new, clean project also, where inserting SDKs was the first step.
Cleaned derived data for few times,
remove from Podfile versioning for that SDK (pod 'Mapbox-iOS-SDK', '~> 6.0.0' as pod 'Mapbox-iOS-SDK' )
even when SDK is added through CocoaPods, can't find frameworks to add into Link Binary With Libraries
even it says Copy Bundle Resources to be checked, couldn't find what to expect there
Note:
Also tried: successfully added Mapbox and MapboxMobileEvents directly into project, but as I found MapboxNavigation SDK could be implemented only through CocoaPods or Carthage, so I'm stuck here.
I would really appreciate for someone's help, who already have faced this problem.
Multiple commands produce '/Users/x/Library/Developer/Xcode/DerivedData/mbNavigationExample-ctztmwiegsuqkigkucoydhnnoaxc/Build/Products/Debug-iphoneos/mbNavigationExample.app/Assets.car':
1) Target 'mbNavigationExample' (project 'mbNavigationExample') has compile command with input '/Users/x/Desktop/mbNavigationExample/mbNavigationExample/Assets.xcassets'
2) That command depends on command in Target 'mbNavigationExample' (project 'mbNavigationExample'): script phase “[CP] Copy Pods Resources”

Adding Pods to Xcode project brakes build

Forgive me, I am new to IOS Development. I have debugged this for a while now and tried all available solutions I could find. I added Pods to my Xcode project and the build now fails. I verified that after running "pod deintegrate; pod clean" the build works again. When I run "pod install" again and open the .workspace (not the .xcodeproj) - the build fails. I have tried every solution I could find.
I have already tried:
Deleting derived data (many times)
Restarting computer/xcode (many times)
verifying that I am opening the workspace, not the project
cleaning the project and re-building (many many times)
Deleting the Pod-.framework from the Frameworks folder and reading it to the Linked Frameworks and Libraries
Editing the build scheme to include Pod-.framework
Adding the pod frameworks to the Linked Frameworks and Libraries
Adding the pod frameworks to the Embedded Libraries
Editing the Framework Search Path in Build Settings
Building to an actual device and simulator
Heres my Podfile:
#platform :ios, '12.0'
target 'Burnt' do
use_frameworks!
pod 'MaterialComponents'
end
Versions:
MacOS version: 10.13.6
Xcode version: 10.1
Swift version: 4.2
CocoaPods version: 1.6.2
The Error:
ld: framework not found MaterialComponents
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Helpful Screenshots:
File Structure
General Settings
The Evil Error
please check MaterialComponents github version you are using right one or not
or try with
pod try MaterialComponents --> on github page
Try changing your swift version to 5 and compile and then you can change it back to 4.2 ..seems like some xcode linking glitch..
Can you compare your Project version(swift_version) and installed pod version are same?
i think this OS issue update your macOS and also update cocoapods.
Try new project to install pods.

Support CocoaPod and Carthage

I've created and published a Cocoapod using pod lib create. Now I also want to support Carthage, but after adding the path to the GitHub project to my Cartfile and running carthage update --platform iOS I'm getting the following error:
Dependency "" has no shared framework schemes for any of the platforms: iOS
Any idea how to fix this?
How it should work:
To add support for Carthage for your existing CocoaPods library you need to share the scheme of your CocoaPods project. To do that you have to:
Open the workspace that contains your pod (it should contain example and Pods projects).
Go to Product > Scheme > Manage Schemes.
Select the Shared checkbox for your pod scheme (scheme with the name of your library in Pods project).
Test if the scheme builds successfully by running carthage build --no-skip-current.
Possible problems
If you created your pod using pod lib create you might see that all schemes are already shared but carthage build --no-skip-current still fails with error message:
Dependency "" has no shared framework schemes for any of the platforms: iOS
This is because Xcode shows that the schemes are shared but the .xcodeproj/xcshareddata/xcschemes/YourProjectName.xcscheme file that marks the scheme as shared is missing. To fix this just uncheck and check the scheme sharing checkbox and the file should be created. Now you just need to commit and push the file to your repository.

Cocoapods doesn't see a project added to Xcode framework as viable target

I'm trying to integrate a new project into an Xcode workspace with dependencies handled by Cocoapods. I added the Backend project (builds fine on itself, returns a framework as a product) to the workspace and added a separate target in the Podfile:
target 'Backend' do
(Pod list here)
end
Yet when trying to run pod install, I get [!] Unable to find a target named 'Backend'.
Using Xcode 7.2, Cocoapods 0.39.0
CocoaPods doesn't support integrating with frameworks, see https://github.com/CocoaPods/CocoaPods/issues/3440

Resources