After installing Firebase with CocoaPod, I can no longer build - ios

I'm trying to build Javascript source code as an iOS app using Cordova.
I have introduced firebase with CocoaPods, and I am very troubled because I can not build.
this is wannings
Ignoring file /Users/MYNAME/Library/Developer/Xcode/DerivedData/ProductName/Build/Products/Debug-iphonesimulator/CocoaLumberjack/CocoaLumberjack.framework/CocoaLumberjack, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
This is Error
Undefined symbols occur in large numbers
This is my Cocoapod profile.
platform :ios, '10.0'
use_frameworks!
target 'product_name' do
use_frameworks!
project 'product_name.xcodeproj'
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'FirebaseFirestoreSwift', '~> 0.2'
# ID Instance
pod 'Firebase/Messaging'
# config
pod 'CocoaLumberjack/Swift'
# Pods for PodTest
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'
# Bluetooth
pod 'RxBluetoothKit'
# debug
pod 'SimulatorStatusMagic', :configurations => ['Debug']
# design pattern
pod 'Swinject'
# zip
pod 'Zip'
# Protect UI
pod 'iOSDFULibrary'
pod 'libb2s'
end
target 'shareExtension' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'FirebaseFirestoreSwift', '~> 0.2'
# ID Instance
pod 'Firebase/Messaging'
# config
pod 'CocoaLumberjack/Swift'
# Pods for PodTest
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'
# Bluetooth
pod 'RxBluetoothKit'
# debug
pod 'SimulatorStatusMagic', :configurations => ['Debug']
# design pattern
pod 'Swinject'
# zip
pod 'Zip'
# Protect UI
pod 'iOSDFULibrary'
pod 'libb2s'
end
My Enviroment:
XCode Version 11.5
CocoaPods Version 1.9.3
What I have done so far.
STEP 1 : Solved CocoaPods Warnnings.
STEP 2 : Error Id: library Not Found XXXX
→ I installed the Not Found framework with CocoaPod(And decided to install a lot)
STEP3 : Modify Library Search Paths
STEP4 : Set Build Active Architecture Only explicitly to No
If anyone has experienced a similar error, I would like some advice on the current error.
Thanks.

I solved my problem.
I found an explanation in the condition of the build using the simulator.
Premise:
Why does the iOS simulator require i386 and x86_64 symbols even though I'm on an x86_64 system only?
Implementation example:
Could not find module for target 'x86_64-apple-ios-simulator'
In my project, I have to cleat Cordiva - Firebase relationship.
After,question,I did two Implementation.
STEP1: Find out why I can't build
Refer to the above article or build on the our iPhone.
STEP2: Organize compatibility
Make CORDOVA a parent element and make other targets child elements
THANKS!!

Related

Firestore build error in abseil with Swift and Cocoapods

I have a swift project that is using Firestore. There is a build issue when compiling the abseil pod that is included by Firestore. When I attempt to build the project, I intermittently get this error: absl/base/internal/inline_variable.h file not found.
I am using Xcode 11.4, Cocoapods 1.9.1, and Swift 5.
I have tried clearing derived data, updating pods, and deintegrating pods. The one workaround that seems to work is the following, but when I switch devices for a build, the error occurs again.
1. Comment out Firestore in the Podfile.
2. Run bundle exec pod install
3. Open Xcode and build.
4. Uncomment Firestore in the Podfile.
5. Run bundle exec pod install
6. Open Xcode and build.
These steps will work temporarily. Does anyone know of a way to get past this issue?
Here is the Podfile that I am using:
source 'git#git.myresearchapp.com:MyCompany/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'MyApp' do
use_frameworks!
pod 'RNCryptor'
pod 'KeychainSwift'
pod 'Sentry', git: 'https://github.com/getsentry/sentry-cocoa.git', tag: '3.11.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'UICircularProgressRing', '~>4.1.0'
pod 'IHKeyboardAvoiding', git: 'git#git.myresearchapp.com:MyCompany/IHKeyboardAvoiding.git', branch: 'master'
pod 'GTProgressBar'
pod 'AWSSNS'
pod 'AWSCognito'
pod 'AWSS3'
pod 'Validator', git: 'https://github.com/jlowe234/validator'
pod 'SwiftyOnboard', git: 'git#git.myresearchapp.com:MyCompany/SwiftyOnboard.git', branch: 'master'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
I solved this problem by updating to the latest version of Sentry. Apparently there is a build conflict between Firestore and version 3.11.0 of Sentry.
The fix is to change the Podfile entry for Sentry to the following:
pod 'Sentry'
After spending hours searching and trying to solve this issue, the only solution was to add a pre-compiled Firestore SDK.
add this line to the PodFile
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'
refer to firestore-ios-sdk-frameworks for more info

pod not been updated, even though it shows an update available through 'pod outdated'

I'm trying to update my pods, I list the pods updates through
pod outdated
podfile ( Further more I have even tried to out 'Firebase/Auth', '6.3.1' in podfile to specify the version but no use ["-" used in place of app, NDA -_- ] )
# Uncomment the next line to define a global platform for your project
use_frameworks!
platform :ios, '9.0'
def extension_pod
# pod 'ReadabilityKit', '0.7.1'
pod 'SDWebImage', '~> 4.0'
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI/Database'
pod 'Firebase/Storage'
pod 'Firebase/Core'
end
target '-' do
extension_pod
pod 'LGSideMenuController'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
#pod 'FirebaseUI', '~> 5.0'
pod 'Firebase/Messaging'
pod 'TOCropViewController'
# [START google_pod]
pod 'GoogleSignIn', '4.1.2'
pod 'ARSLineProgress'
#pod 'TesseractOCRiOS', '4.0.0'
# [END google_pod]
pod 'TwitterKit'
pod 'DateTools'
pod 'Fabric'
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for -
target '-Tests' do
inherit! :search_paths
# Pods for testing
end
target '-UITests' do
inherit! :search_paths
# Pods for testing
end
target '-E' do
extension_pod
end
end
Commands that I have done so far to update my Firebase/Auth repo,
pod update 'Firebase'
pod update 'Firebase/Auth'
pod install --no-repo-update
pod repo update && pod update 'Firebase/Auth'
All of these show as follow, but does not update to the specific version shown by pod outdated, am I missing some command for update process to occur?
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 17 dependencies from the Podfile and 33 total pods installed.
Another dependency requires FirebaseAuth to be a lower version. See the Podfile.lock to get the details.
Note that you want to update the FirebaseAuth pod - not Firebase/Auth which is the Auth subspec in the Firebase pod.
It might be related to locking the GoogleSignIn pod to an old version.
Change platform :ios, '9.0' to platform :ios, '10.0'

'FirebaseCore/FirebaseCore.h' file not found in swift5 on ios

I have a problem using FireBase. I had no problem with the build, but there was an error with the Firebase in iOS10.3 and I tried the suggested solution.
rm -rf ~/Library/Developer/Xcode/DerivedData/
And then I erased the cache and rebuilt it. However, the error has been changed.
'FirebaseCore/FirebaseCore.h' file not found Could not build // firebase.h
Objective-C module 'Firebase' // Appdelegate.swift
my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'testtest' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for DeleteMe
pod 'SwiftSVG', '~> 2.0'
pod 'Toaster'
pod 'BigInt', '~> 4.0'
pod 'CryptoSwift'
pod 'RealmSwift'
pod 'web3.swift.pod', '~> 2.2.0'
pod 'Firebase'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Core'
end
I erased Pod and tried to rebuild it, but the error was the same.
$ pod deintegrate
$ pod clean
$ pod install
How can you solve this problem?
Xcode : Version 11.0
realDevice : iphone5 10.3
I just built my other test iPhone 6 version 12.4, but there was no error. There seems to be a problem in version 10.3.

Cocoapods not setting search paths correctly

I opened an iOS (Swift) project today I hadn't touched for a while and it wouldn't build. The first import statement for a Cocoapods framework was throwing a No such module compile error in Xcode. Changing the order of import statements made the error throw on whichever was the first external dependency in my import list.
I fixed this by adding each of my Cocoapods to Framework Search Paths in my project's main target (it has a few targets, including tests, a share extension, and a framework of shared code for the app and extension). These search paths were empty and now look like this:
After doing that the project built fine, but now I'm getting this SIGABRT error every time I try to run the app (both on simulator and device):
dyld: Library not loaded: #rpath/CocoaLumberjack.framework/CocoaLumberjack
Referenced from: [path removed]
Reason: image not found
My guess is this is to do with CocoaLumberjack needing to be linked somewhere else/some other way because of its macros but I don't really know.
I've also tried running pod install, cleaning the build folder and deleting derived data, and running pod deintegrate + pod install with no success.
Is it possible to get Cocoapods to automatically set up my search paths correctly so I don't have these issues? Or is there a manual step I'm missing or have done wrong perhaps?
Edited to add my Podfile:
platform :ios, '11.0'
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!
# This is my shared framework, used by both my app and share extension
target 'XXXShared' do
pod 'SnapKit', '~> 4.0'
pod 'KeychainSwift', '~> 7.0'
pod 'Reveal-SDK', :configurations => ['Debug']
pod 'IQKeyboardManagerSwift'
pod 'APESuperHUD', :git => 'https://github.com/apegroup/APESuperHUD.git'
pod 'WSTagsField', '~> 3.1'
pod 'Cache', '~> 4.2'
pod 'TableKit', '~> 2.5'
pod 'GRDB.swift', '~> 3.2'
pod 'PromiseKit', '~> 6.0'
pod 'Toast-Swift', '~> 3.0.1'
pod 'CocoaLumberjack/Swift'
pod 'CollectionKit'
pod 'PinLayout'
pod 'FlexLayout'
pod 'LayoutKit'
pod 'PromiseKit/Alamofire'
pod 'Alamofire', '~> 4.7'
end
target 'XXX' do
pod 'Reveal-SDK', :configurations => ['Debug']
end
target 'XXX share extension' do
inherit! :search_paths
end
Edited to add screenshots:

UITest bundle could not be loaded

When i run the UITest in my phone it installs and runs as a separate app while giving the following error.
2017-07-27 10:44:33.892639+0700 XCTRunner[11886:3502890] Running
tests... 2017-07-27 10:44:34.137927+0700 XCTRunner[11886:3502890] The
bundle “...UITests” couldn’t be loaded because it is damaged or
missing necessary resources. Try reinstalling the bundle. 2017-07-27
10:44:34.137999+0700 XCTRunner[11886:3502890]
(dlopen_preflight(/var/containers/Bundle/Application/75C9B589-CCD4-480D-9E23-BA86878E8B37/...UITests-Runner.app/PlugIns/...UITests.xctest/...UITests):
Library not loaded:
#rpath/GoogleToolboxForMac.framework/GoogleToolboxForMac Referenced
from:
/var/containers/Bundle/Application/75C9B589-CCD4-480D-9E23-BA86878E8B37/...UITests-Runner.app/PlugIns/...UITests.xctest/...UITests
Reason: image not found)
I am trying to find a solution for this problem more than a day.
I wanted to add UITests to my existing app and added UITest target to my app. I am using both carthage and cocoa-pod. I updated pod file and updated pod then i added frameworks to the UITest target which are installed by carthage.
This is my pod file
platform :ios, '9.0'
use_frameworks!
target 'ExampleApp' do
pod 'Charts'
pod 'ReachabilitySwift', '~> 3'
pod 'Fabric'
pod 'Crashlytics'
pod 'Google/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
target 'ExampleAppTests' do
pod 'Charts'
pod 'ReachabilitySwift', '~> 3'
pod 'Fabric'
pod 'Crashlytics'
end
target 'ExampleAppUITests' do
pod 'Charts'
pod 'ReachabilitySwift', '~> 3'
pod 'Fabric'
pod 'Crashlytics'
end
This is my cartfile
github "Alamofire/Alamofire" ~> 4.0
github "SwiftyJSON/SwiftyJSON" "3.0.0"
github "Friend-LGA/LGSideMenuController" ~> 1.0.0
github "TTTAttributedLabel/TTTAttributedLabel" ~> 1.13.4
github "MagicalPanda/MagicalRecord"
I could find a related question from stack overflow but unfortunately it was not helpful. can you please help me to add the UITest target to my project without a issue.
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
use_frameworks!
def base_pods
pod 'FBSDKCoreKit', '4.24.0'
pod 'FBSDKLoginKit', '4.24.0'
pod 'FBSDKShareKit', '4.15.0'
pod 'FacebookCore', '0.2.0'
pod 'FacebookLogin', '0.2.0'
pod 'FacebookShare', '0.2.0'
end
target 'App' do
base_pods
target 'AppTests' do
inherit! :search_paths
# Pods for testing
end
target 'AppUITests' do
inherit! :complete
# Pods for UI testing
end
end
the line inherit! :complete is key here
and in settings for the UITest target
NEXT:
clear derived data
pod deintegrate && pod install

Resources