OneSignal can't build for MacCatalyst - swift

I tried to use OneSignal with MacCatalyst but i get the error below. Everything works if I run it on iOS.
Error:
ld: in /<PROJECT_PATH>/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/OneSignal(OneSignal-x86_64-master.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '<PROJECT_PATH>/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/OneSignal'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks!
Environment
Xcode 11.5 (11E608c)
macOS 10.15
OneSignal via Cocoapods (latest version)
Steps to Reproduce Issue:
Enable Mac in your Deployment Info
Install the latest OneSignal iOS SDK using Cocoapods
Setup OneSignal in your NotificationExtension as shown below.
Try to run your code on your Mac using macOS 10.15
ERROR
Anything else:
I tried almost everything that was mentioned on this post https://github.com/OneSignal/OneSignal-iOS-SDK/issues/534, but nothing seem to work.
I also tried to add x86_64h:
This is my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyProjectName' do
# Comment the next line if you don't want to use dynamic frameworks
# Pods for MyProjectName
pod 'FSPagerView'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Performance'
pod 'OneSignal'
end
target 'OneSignalNotificationServiceExtension' do
#only copy below line
pod 'OneSignal'
end

Related

Trying to install GeoFire through Cocoapods, but getting Objective-C Module error

So there is an odd build issue I’m encountering.
I have an existing Xcode project where all my packages have been added through Xcode itself (I think Xcode basically uses Swift Package Manager underneath).
I came to a point where I needed to now use GeoFire . But Geofire needs to be installed through Cocoapods. But my Xcode project never used cocoapods.
So to integrate Cocoapods I did the following:
brew install cocoapods
opened terminal and navigated to root directory of iOS app (where <app-name>.xcodeproj exists)
pod init
opened the generated Podfile and added the following:
…
platform :ios, '11.0’
…
pod 'GeoFire', '~> 4.0’
…
pod install
opened <app-name>.xcworkspace
Then when I went to build the project, the following failure occurred (see image attached to question)
None of the workarounds suggested have helped me thus far. Any thoughts?
NOTE: I am doing all this on an M1 Macbook.
Wow, strange issue.
What ended up fixing it for me was to go to my pod file and replace:
pod 'GeoFire', '~> 4.0'
With:
pod 'GeoFire/Utils'
Now I can use GeoFire in my file as I wish.

undefined symbols for architecture x86_64 when add google map Sdk in Xcode

when i install google map with Cocoapods
when build p .xcworkspace
give me an error
linker command failed with exit code
my pod file
platform : ios, '12.1'
source 'https://github.com/CocoaPods/Specs.git'
target 'mapapp' do
pod 'GoogleMaps'
pod 'GooglePlaces'
end
i attach picture
plese help me

Xcode 9 fails to build Swift 4 project with pod

When attempting to build my Swift 4 project in Xcode 9 beta 2, some code signing error occurs after which the build of my app is discontinued.
The error that is shown in Xcode:
/usr/bin/codesign --force --sign - --preserve-metadata=identifier,entitlements '/Users/nickgaens/Library/Developer/Xcode/DerivedData/Emprova_Swift-bbvmoytlhlbqpueyftstselvwhdj/Build/Products/Debug-iphonesimulator/Emprova GPS Swift.app/Frameworks/Alamofire.framework'
/Users/nickgaens/Library/Developer/Xcode/DerivedData/Emprova_Swift-bbvmoytlhlbqpueyftstselvwhdj/Build/Products/Debug-iphonesimulator/Emprova GPS Swift.app/Frameworks/Alamofire.framework: No such file or directory
As you might notice, the --sign argument is followed by a single - character.
My setup:
Xcode 9 beta 2 (9M137d) with its bundled Swift 4-version
Cocoapods v1.2.1 with Podfile
platform :ios, '10.0'
target 'Emprova GPS Demo Swift' do
use_frameworks!
pod 'Alamofire', '~> 4.5.0'
pod 'AlamofireNetworkActivityIndicator', '~> 2.2.0'
pod 'KeyClip'
pod 'Localize-Swift', '~> 1.7.1'
pod 'FMDB'
end
target 'Emprova GPS Swift' do
use_frameworks!
pod 'Alamofire', '~> 4.5.0'
pod 'AlamofireNetworkActivityIndicator', '~> 2.2.0'
pod 'KeyClip'
pod 'Localize-Swift', '~> 1.7.1'
pod 'FMDB'
end
I didn't change a single letter of any of the added pods files.
I opened Pods.xcodeproj to check and double check Build Settings - Code Signing Identitiy of the Alamofire pod/target, but it is set to Don't Code Sign.
I already checked my Keychain Access app to see if the Apple Worldwide Developer Relations Certification Authority wasn't expired (it isn't) and is marked as trusted (it is).
I already emptied the DerivedData directory multiple times (~/Library/Developer/Xcode/DerivedData) and performed a Clean (both via Cmd+K and Cmd+Alt+Shift+K to no avail.
I already attempted to set the Xcode 'Command Line Tools' (Preferences - Locations - Command Line Tools) to both Xcode 8.3.3 (8E3004b) and Xcode 9.0 (9M137d) to no avail.
Completely ran out of ideas after having spent multiple hours searching for a solution. Does anyone have a clue why Xcode 9 no longer builds my project?
Also, link to my issue on Alamofires GitHub page, for the sake of completeness: #2183.
I found out what's wrong! Xcode continued using the .xcodeproj file to open my project when selecting it on the welcome screen, but Cocoapods requires the .xcworkspace file to be used! There's a visual distinction between both entries on Xcode's Welcome screen afterwards: difference between Xcode workspace and project on Welcome screen.
Opening the workspace shows two projects in Xcode's Project Navigator: one for my app and a second one named Pods, which embodies all installed pods. Building the app no longer shows weird build errors.

FirebaseAnalytics framework not found

I'm having a problem with FirebaseAnalytics since running a pod update. I get the error
ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and reviewed the answers to this error from other people.
In the case of my app, 'FrameworkSearchPaths' (default and release) looks like this:
$(inherited)
"$PODS_CONFIGURATION_BUILD_DIR/GTMSessionFetcher"
"$PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac"
"${PODS_ROOT}/FirebaseAnalytics/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseAuth/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseCore/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseDatabase/Frameworks"
"${PODS_ROOT}/FirebaseInstanceID/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseStorage/Frameworks/frameworks"
"${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks/frameworks"
"${PODS_ROOT}/GoogleSymbolUtilities/Frameworks/frameworks"
The pod folder looks like this...
My podfile looks like this:
platform :ios, '10.0'
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Auth'
target 'MyApp' do
end
target 'MyAppTests' do
end
target 'MyAppUITests' do
end
Does anyone have a sequential approach to debugging this error? I didn't have the problem before the pod update.
I've tried a mac restart, reinstalling cocoapods, and re-running both pod update and pod install. I'm working with the latest xCode version.
*********** Update ***************
I've tried some more things:
changing the order of Framework Search Paths, putting the call to FirebaseAnalytics at the end
running shift-command-F to find references to 'FirebaseAnalytics' to see if there are any duplicates or patterns of references that look wrong (didn't see anything)
deleting FirebaseAnalytics and running re-install
the solution proposed in this answer Apple Mach-O-Linker Error CocoaPods by deleting the contents of Other Linker Flags
None of these fix the issue I'm having
More ideas on how to debug the problem are welcome
Go to OtherLinkerFlags in build settings of target & remove 'FirebaseAnalytics" & '-framework' from there.
This works for me.

Linking error when building Parse in Xcode 7

I am trying to add the Parse.com SDK to my Xcode 7 project. I have followed the getting started guide and I have managed to do it before in Xcode 6.
However this time I am being shown this error message when I try to build:
ld: framework not found Bolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks
There seems to be an issue with Xcode 7 beta where the search path for manually added frameworks is missing.
To fix the issue add the search path by doing the following:
Select Project
Click on Targets
Click Build Settings
Search for: Framework Search Path
Add the following without the quotes: "$(PROJECT_DIR)" and choose recursive option.
The project should build now.
I suggest you integrate Parse using CocoaPods.
Cocoapods manages the library dependencies in a much better way.
The following is a sample PodFile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
inhibit_all_warnings!
target '**YourProjectName**' do
pod 'Parse', '~> 1.7.1'
pod 'AFNetworking', '2.2.3'
end