I follow the guide on their home page.
https://docs.sentry.io/platforms/apple/guides/ios/
I call pod deintegrate and then after I call pod install.
The error appears immediately after I call pod install and I have no idea why.
The Library Sentry.Framework is in Link Binary With Libraries under build Phases in my target app.
I have tried looking through SO for similar issues, but none actually solve the issue for me.
I have tried to clean build, added $(inherited) to other linker flags and adding path to framework search path($(PROJECT_DIR/Pods/Sentry) I don't know whether this is the correct way to do it). None of the mentioned solved the issue.
Any leads to what could be wrong would be appreciated.
UPDATE:
platform :ios, '9.0'
use_frameworks!
target 'yourApp' do
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '7.2.2'
end
The above is my Pod File
Instead of using the module import #import mapped by .modulemap, could you add as declarative framework library #import.
Module import:
#import Sentry;
Framework import:
#import <Sentry/Sentry.h>
Related
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 seem to have a issue with my project settings, in Xcode 8. The issue is as follows:
When adding a new Pod - lets say, Pod Firebase - the install works, and adds the necessary files to my project. I can then, do #Import Firebase
All is fine, up to this point. However, as soon as I make a reference to the Firebase API example: [FirApp configure]; - all is still fine - autocomplete on Xcode works as expected and no issues. However, when building I then get a compile time issue which states:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRAppIndexing", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The only way I am able to solve this - is by manually adding the _FIRAppIndexing.framework in my projects, Build settings, under Link Libraries with Libraries
To do that, I just drag and drop the frame work from the project navigator to the correct section under link libraries.
This works sometimes; as with other parts of the Firebase SDK, I get runtime crashes.
So, to try get to the root cause, I created a brand new test project, installed the Pods using Pod install - I however did not have to add the framework manually to Libraries - its actually not even listed there.
Everything in the test project worked just fine, at compile and run time.
Which leads me to believe its something in my project settings that's causing this.
Things I have tried
Removed cocoapods completely with pod deintegrate and removed all
other traces of it. Then did a clean build. Then Pod install
Added -objc to linker flag
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Crashlytics'
pod 'AsyncDisplayKit', '>= 2.0'
pod 'Firebase'
pod 'Firebase/Messaging'
pod 'FBSDKCoreKit'
pod "HockeySDK", :subspecs => ['AllFeaturesLib']
pod 'Fabric'
pod 'FirebaseAppIndexing'
pod 'AFNetworking', '~> 3.0'
pod '1PasswordExtension', '~> 1.8.4'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
end
GitHub example project
https://github.com/TanderZA/MyApp
I duplicated my current project - and removed all files. Problem still exists. You will see the project won't compile due to linker errors, with references to the Firebase AP.
By manually adding the frameworks to Link Libraries with Libraries, you will see that it should compile. But that is not how it should work. The current project has an issue with infoPlist.strings that I did not solve. But the project is in the state to demonstrate the issue.
I have checked the project, it seems you have messed up with schemes.
Create a new scheme properly then install the pods again and as the project is in Obj-C you don't need to enable frameworks in the podfile.
So comment like # use_frameworks!
Also update the pods using pod update
Then select the new scheme and build the project in it.
Let me know if you are not able to do it.
It is a xcode bug by the way
But try this :
Upgrade to latest version of xcode and Pods
Remove all architectures in your project
Clean your project
Add arcitectures from start.
This should resolve the issue.
Have you tried to use frameworks?
# platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
I am not sure though but I think what you need is pod 'Firebase/Core'. not pod 'Firebase'.
This link have the list of the Firebase framework that can be used.
And, in the video on the top of the page it says something about there is no single pod that can be installed and you need to set each one of them on the podfile depending on the features you want.
My guess they mislead us in some places where they had pod 'Firebase'. I dont think that they meant that it should do the work.
som try the following:
# Pods for MyApp
pod 'Firebase/Core'
pod 'Firebase/Messaging'
.
.
I know that you said that you had it work on another new project.
I am trying to create a project which uses Realm and RealmSwift. I have used Cocoapods to install these dependencies. I have seen the other posts too on stackoverflow and tried their solutions. They don't work for me. In my project, I'm getting the error "No such module as RealmSwift" when I write the import RealmSwift statement. Here are the steps I took for installation:
I created an empty xcode project
I went into terminal and navigated to my project directory
I gave the pod init command to create a pod file
I went into the pod file(it already had the use_frameworks! statement
I wrote in pod 'Realm' and pod 'RealmSwift'. I gave the sources as:
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
I wrote in pod install
The pods were installed successfully. I went into the .xcworkspace file.
I had already installed the realm plugin so I created a new realm object file
The template file opens with the following file. I'm getting the error that there is no RealmSwift module.
What am I doing wrong? Or what am I not doing? Is a bridging header required? Has anybody else managed to resolve this error?
Any relevant suggestions or insights are most welcome.
Its working now! Its so weird since I didn't do anything. I just went into my pod file commented out the use_frameworks! statement and ran pod update on the terminal. It gave me an error, so I added it back to my pod file. I wrote in pod update again and hit enter. I restarted Xcode cleaned it and built it and I wasn't getting this error anymore.
Need to uncomment platform in your pod file then try once again your pod.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0' // Uncomment this
# Uncomment this line if you're using Swift
use_frameworks!
target 'Demo_Realm' do
pod 'RealmSwift'
end
target 'Demo_RealmTests' do
end
target 'Demo_RealmUITests' do
end
I am getting an error when building my app after i removed reference to a framework i added incorrectly. i am new to ios and cocoapods
/Users/MyMac/Library/Developer/Xcode/DerivedData/MyApp-ewxrexwuczochyctnqvlyusrtvvy/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Script-5874133373474758EEC76CFD.sh: line 2: /Users/MyMac/Documents/MyApp/Pods/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh: No such file or directory
I am aware that the file and directory don't exist and that is the way it should be but where is it finding the reference to this file so i can remove it and be rid of the error.
I have checked the following:
Linked Frameworks andLibraries under the general tab of my project
The frameworks group in the project
framework search paths under build settings tab
i have also run pod update after removing it from the pod file
How can i fix this?
Edit
back story
I was trying to add the framework https://github.com/Alliants/ALAccordion . in the instruction it said to use
# Podfile
target 'My Target' do
use_frameworks!
pod "ALAccordion"
end
so i added MyApp where my Target is and it created a framework named Pods-MyApp which i cant remove completely.
hope this helps
Cocoapods wrote a tool to completely deintegrate all of this stuff from your project so it goes back to running standalone. It sounds like you had an issue adding the correct target, so use this:
https://github.com/CocoaPods/cocoapods-deintegrate
Then try again so you can at least start from good ground. Hope this helps!
It happened with a prerelease version of Cocoapods 1.2.0.beta.1, by reverting to stable version and running pod install, then clean build, it worked.
why
use_frameworks!
after
target ... do
here is example
platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!
target 'XXX' do
pod 'RealmSwift'
end
target 'XXXTests' do
pod 'RealmSwift'
end
I'm starting a new Swift project and I'm trying to create unit tests for it. I added the Google Analytics framework to the project and linked SystemConfiguration, CoreData, libsqlite3, libz, and libGoogleAnalyticsServices.
I then had to manually create a bridging header and added the GA headers I was going to use immediately. The app was up and running and posting to GA. I then tried to add some unit tests.
Once this happens I receive an error in my bridging header that 'GAI.h' file not found from the test target if I add a bridging header to it. I also receive a Segmentation Fault 11 error from the compiler. The error remains the same without a bridging header.
I have tried linking my test target with SystemConfiguration, CoreData, libsqlite3, libz, and libGoogleAnalyticsServices. This does not get rid of the error.
There is not much to my bridging header at the moment.
#import "GAI.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAIFields.h"
I'm also using cocoapods but I'm not using it with Google Analytics at the moment since there was so much I needed to manually change in the config files every time I would run the pod process. If it helps here is my pod file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'JVFloatLabeledTextField'
# Swift Pods
pod 'Alamofire'
pod 'JSONHelper'
target 'example' do
end
target 'exampleTests' do
pod 'Quick', :git => "https://github.com/Quick/Quick"
pod 'Nimble', :git => "https://github.com/Quick/Nimble"
end
I haven't been able to write any tests yet because I'm not able to get passed the linker errors. Any ideas?
As stated in my comment above, I think I experienced the same or a similar issue: my code worked fine when I ran it, but when I tried to run tests, I got a Segfault 11 on trying to instantiate an object that referenced anything from a cocoa pod. I've solved it in my case.
When I had the error, my Podfile looked like this:
pod 'ReactiveCocoa'
target 'MyTests' do
use_frameworks!
pod 'Quick'
pod 'Nimble
end
use_frameworks! was the culprit: because use_frameworks! only applied to the testing target, I ended up linking to ReactiveCocoa statically when building for the normal target, and dynamically in the test target. I was missing some ReactiveCocoa imports that were required only when linking dynamically, but instead of the compiler telling me that it segfaulted.
My Podfile now looks like this:
use_frameworks!
pod 'ReactiveCocoa'
target 'MyTests' do
pod 'Quick'
pod 'Nimble
end
There were a few linking issues to work out but they were easy from there, because when I compiled the main target I got sane errors. Hopefully this helps someone :)