My automatic iOS build on AppCenter fails with the following error (snippet):
ViewController.swift:10:8: error: no such module 'MBCircularProgressBar'
import MBCircularProgressBar
^
But I don't know what the problem might be. I'm using CocoaPods to import that framework.
My Podfile looks like this (removed all other pods):
target 'MyApp' do
use_frameworks!
pod 'MBCircularProgressBar'
end
And I have a Post Clone script appcenter-post-clone.sh which is recognized in AppCenter that contains:
#!/usr/bin/env bash
pod repo update
pod install
EDIT: After moving the offending file down in the list of files to compile, I get the same error for another CocoaPod. So it seems to me that no CocoaPods are being found
What is going wrong here?
Can you check you are building your projects workspace? You'll need to build the workspace in orde to get Cocoapods to work, not the Xcode project.
Related
I am facing an error while making a flutter plugin on the iOS side while using pods. The pods are installed successfully then also I am able to import them in the file.
The pod in my case which I am trying to use is Freshchat iOS SDK
Steps I have followed to install the pod
Start a new Flutter plugin project.
In .podspec file add s.dependency 'FreshchatSDK'
Run pod install in example/ios folder.
I got an error
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)
I removed use_frameworks! from podfile following this comment .
I ran pod install again and the pods were successfully installed and Pods folder was created which had FreshchatSDK folder in it.
Now I need to have use_frameworks! in my project because other plugins are not compiling because of this.
I added s.static_framework = true in .podspec and use_frameworks! in podfile. Now pod install ran successfully,
After I added the import #import "FreshchatSDK.h" in my Plugin.h file I got the error
error: include of non-modular header inside framework module
I tried this answer but was not able to resolve it.
Please help me resolve this. I'll be respectful of your time.
There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.
There may be problems in the PodFile due to unmatched Targets.
When this happens to me, I used these simple steps.
Delete Podfile
Open Terminal at the specific file
Pod init
Open Podfile and adds Dependencies
Pod install
I'm starting to use Kotlin/native and Appcode for iOS development. I'm trying to get Cocoapods to work with Kotlin/native, but I'm having some challenges.
I've started with the empty Kotlin/native application in AppCode and built that, it builds fine and runs in the Emulator.
Then I try to add Cocoapods with "AFNetworking" I run into trouble. I have tried to follow the JetBrains Kotlin/native sample : https://github.com/JetBrains/kotlin-native/tree/master/samples/cocoapods , but still no luck.
The problems that I'm facing is :
I'm not able to import the cocoapods.AFNetworking in my Kotlin file.
I'm getting the following error when I try to build the project : "Cannot perform cinterop processing for AFNetworking: cannot determine headers location."
I might have overlooked some configurations, but I cant't figure it out.
I'm using Appcode 2019.3.1 , Xcode 11.3(11C29) and Cocoapods 1.8.4
My Podfile looks like this :
My Gradle file looks like this :
My main.kt file looks like this :
Any help is appreciated.
You have to build the project from Xcode first.
Generate the podspec using the podspec gradle task and modify that accordingly then add that to your Podfile
target 'project' do
...
pod 'YourFrameworkName', :path => 'path/to/your-kotlin-library'
end
You could check it here:
https://kotlinlang.org/docs/reference/native/cocoapods.html#interoperability
Edit:
Also, here's a sample of a Kotlin/Native using AFNetworking in the Kotlin code. https://github.com/JetBrains/kotlin-native/tree/master/samples/cocoapods
Edit 2:
Again, you have to link the K/N project to your Xcode Project and build it there.
Step 1: Add the pod to your Gradle file
kotlin {
cocoapods {
...
pod("AFNetworking")
}
}
Step 2: Generate the podspec file through ./gradlew shared-module:podspec
This will generate the podspec file which you might have to modify before building.
Step 3: Use this in your Podfile
target 'project' do
...
pod 'YourFrameworkName', :path => 'path/to/your-kotlin-library'
end
Step 4: pod install
Step 5: Build it in Xcode
After that, you'll be able to reference it in K/N by importing cocoapods.AFNetworking.*
Thanks for the instructions Kurt. I tried to follow them , but still run into problems.
Starting new project in Appcode ( test1) , build ok in Appcode. Opening same project in Xcode , builds ok.
Adds the Cocoapod plugin reference and the pod to my Gradle file and also sets version= "1.0"
Runs the podspec task
Issues "pod setup" , and "pod init"
Adds the pod enty into the Podfile : "pod 'test1', :path => '/Users/trond/Desktop/test1/test1'" . (This comes from the output of podspec)
Issues "pod install"
Reopens Xcode with project : "test1.xcworkspace' and tries to build. It fails with a permision error on "gradlew"
Fixing permisions on "gradlew" with "chmod 777 gradlew"
Tries to build with Xcode again, it fails with : "Project 'test1' not found in root project 'test1' . The task that fails is : "$REPO_ROOT/../Supporting Files/gradlew" -p "$REPO_ROOT" :test1:syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS""
$REPO_ROOT = PODS_TARGET_SRCROOT =/Users/trond/Desktop/test1/Pods/../test1
Im new to swift and going through a Tutorial on integrating AWS tools and I keep getting this error, " No such module 'AWSCore' "
However, on the left, you can see these modules are downloaded and there in the pod File.
My question is how to get rid of these errors and correctly import those features. Any help on how to fix this problem will be much appreciated!
re-create a new 'Podfile' on the Root folder of your Xcode project by running the command:
$ pod init
Now make sure your 'Podfile' contains the AWSCore module like shown below.
platform :ios, '9.0'
target :'MyNotes' do
use_frameworks!
# Analytics dependency
pod 'AWSPinpoint', '~> 2.6.10'
pod 'AWSCore', '~> 2.6.10'
# other pods
end
Kindly note for every module you import in your project you will need to include it in your 'Podfile' and then update the 'Podfile' by running the command :
$ pod install
or
$ pod install --repo-update
Close the Xcode project and then open the *.xcworkspace file to relaunch Xcode
I was able to get past this issue by adding $(BUILD_PRODUCT_DIR) ------ recursive. I added it to me release settings as well.
Do not open PROJ.xcodeproj but rather open PROJ.xcworkspace in some case to build pods.
In your case, other answer should lead to right way.
I keep trying to add https://github.com/jessesquires/JSQMessagesViewController into my project but it keeps coming up with a linking error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what I am doing wrong I can't seem to add the demo into a blank project and get it to work.
This is what I'm doing:
I download the zipfile which contains the demo project folder (not an entire xcode project, just the .h and .m files needed for the demo).
I open a blank xcode project and insert the demo project folder.
I delete the blank project's plist, storyboard, main and app delegate files.
From the terminal, I cd into the project and make a podfile that looks like this:
platform :ios, '7.0'
pod 'JSQMessagesViewController'
pod 'JSQSystemSoundPlayer'
I run pod install.
I open the project in its new workspace that has the pods and I try to run it.
It throws the linking error.
What step am I missing? I see on the GitHub installation process it says:
#import <JSQMessagesViewController/JSQMessages.h> // import all the things
but I don't know what that means. I figured it meant something about updating your headers seach path but when I look at that under Build Settings its already pointing to the header file in the pods.
Is there an obvious step I'm missing when adding a third party library?
I installed JSQMessagesViewController through cocoapods in my project, I did not get any errors successfully installed.Please try the following steps:
Open Terminal and navigate to the directory containing your project by using the cd command:
cd ~/Path/To/Folder/Containing/Project
Next enter this command: pod init
Type this command to open Podfile using Xcode for editing:open -a Xcode Podfile.
Copy and paste this line: pod 'JSQMessagesViewController', '6.1.3' and save it.
Type this command: pod install
This installs dependent libraries related to JSQMessagesViewController and JSQSystemSoundPlayer.
After this close the project and go to your project folder ,use the workspace intead of xcodespace : yourProject.xcworkspace. Hope this post might help you.
1.Open a brand new project from Xcode, do not delete anything.
2.cd ~/ROOT_PATH_OF_YOUR_PROJECT
3.Edit your Podfile if your already had one
Podfile
platform :ios, '7.0'
pod 'JSQMessagesViewController'
pod 'JSQSystemSoundPlayer'
4.run pod install
5.open yourproject.xcworkspace
6.Build
I recently had to delete a xcode project from my computer and re-clone it down. After cloning it, I ran a pod install and then went to build the project. However, I kept hitting a error in my .pch file that claimed a file (a pod file) was not found.
I looked into the following SO posts:
iOS - Build fails with CocoaPods cannot find header files
Unit Test build failing when importing MagicalRecord
From there I gathered that I needed to add to Header Search Paths the $(inherited) flag. I've done that, I've cleaned the project, and then re-built it, and still am having the following error..
As of version 2.3.0 (released on 1 June 2015) the file CoreData+MagicalRecord.h seems to have been renamed to MagicalRecord.h only.
If you installed MagicalRecord using CocoaPods and ran pod install or pod update again you might have gotten this new version and will end up with the same error message: CoreData+MagicalRecord.h file not found
So you should change the import of the header in your pch file then. This is what I have now:
Try to add this line on top of your podfile:
link_with ['ProjectName', 'ProjectNameTests']
before this line
platform :ios, '8.0'
Install pod, and at your project Build Setting->Other Linker Flags, add $(inherited).
import "MagicalRecord/MagicalRecord.h"
Try to run command (1) in terminal, then add import in step (2)
In your project directory,run pod update
You should now be able to add
#import <MagicalRecord/CoreData+MagicalRecord.h>
to any of your target's source files and begin using MagicalRecord!
I think with 2 steps you can be solved this problem.