im trying to use Starscream both on iOS and WatchOS with Cocoapods.
here's my podfile:
inhibit_all_warnings!
def all_pods
pod 'Starscream', '~>3.0.5'
end
target ‘ProjTest’ do
platform :ios, '10.0'
use_frameworks!
all_pods
end
target 'ProjTestTests' do
inherit! :search_paths
end
target 'ProjTestUITests' do
inherit! :search_paths
end
target 'ProjTestWatch' do
platform :watchos, '5.0'
all_pods
end
I have a class, SocketManager, that I use on the app already, I just want to use that same class on the watchApp Target, but the only error im getting is : No such module 'Starscream' on the import line.
The most weird for me, is if im go look the Framework Search paths, and Header Search Paths on the Watch Target, they're both empty. But if I try to do the same as the iOS app target. and put an $(inherited), they inherit the libs from the iOS App.
Related
I am stuck with an issue since past 5+ hours, I am working on a react native project of version 0.59.0, it is a 1.5 years old project and it is working fine on android, but when building it for iOS, I was facing many issues one of which was:
ld: library not found for -lFirebaseCore
So to make it work, I included arm64 in excluded architecture and my build started working on simulator but my IPA was not working on a real device, again after removing arm64 and resolving multiple issues, I am stuck with the following issue which is coming in RNFirebaseLinks.m file as :
ARC Semantic Issue Group: No known class method for selector 'componentsWithLink:domain:'
Also sharing my device specifications:
macos: Macbook pro(11.0.1), chip: Apple M1,
Xcode version: 12.4
PodFile content:
**# Uncomment the next line to define a global platform for your project**
platform :ios, '10.0'
target 'PropertiesPublisherNew' do
**# Uncomment the next line if you're using Swift or would like to use dynamic frameworks**
#use_frameworks!
**# Pods for PropertiesPublisherNew**
pod 'Firebase/Core', '6.3.0'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Database'
**# pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'**
**# pod 'RNScreens', :path => '../node_modules/react-native-screens'**
**# pod 'react-native-netinfo', :path => '../node_modules/#react-native-community/netinfo'**
#pod 'react-native-webview', :path => '../node_modules/react-native-webview'
target 'PropertiesPublisherNewTests' do
inherit! :search_paths
**# Pods for testing**
end
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
target 'PropertiesPublisherNew-tvOS' do
**# Uncomment the next line if you're using Swift or would like to use dynamic frameworks**
**# use_frameworks!**
**# Pods for PropertiesPublisherNew-tvOS**
target 'PropertiesPublisherNew-tvOSTests' do
inherit! :search_paths
**# Pods for testing**
end
end
Can anyone please help me out with this?
Add pod 'Firebase/Core', '~> 5.15.0' in PodFile inside IOS Folder
I have a Realm app that was running fine in Xcode 11 in both, the device and the Simulator. I recently updated to Xcode 12 and now the app doesn't compile in any of the Simulators but works fine on physical devices. After researching I noticed that Realm suggests adding some build settings in your Podfile to exclude the arm64, so I went and added it but I'm still getting errors.
Here is what I have done in more detail.
Original Podfile looked like this:
def shared_pods
pod 'RealmSwift', '~> 3.18'
end
target 'MyApp' do
use_frameworks!
platform :ios, '10.0'
shared_pods
target 'MyAppTests' do
inherit! :search_paths
end
target 'MyAppUITests' do
inherit! :search_paths
end
end
target 'MyApp Watch App' do
use_frameworks!
platform :watchos, '3.1'
# Pods for MyApp Watch App
shared_pods
end
target 'MyApp Watch App Extension' do
use_frameworks!
platform :watchos, '3.1'
shared_pods
end
Here is what I did step by step.
I compiled my app for the first time in Xcode 12 and I got the following error.
I modified my PodFile to what Realm recommends adding the following code at the end of the Podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['EXCLUDED_ARCHS[sdk=watchsimulator*]'] = 'arm64'
config.build_settings['EXCLUDED_ARCHS[sdk=appletvsimulator*]'] = 'arm64'
end
end
end
In the terminal I entered pod install.
Recompiled my project and it got rid of the first error but it now shows the following error.
Any idea what could be wrong now?
In my case upgrading Realm to the latest version, 10.1.0 and updating cocoapods to 1.10.0 solved the issue, I can now compile on the Simulator.
I'm trying to run a UI Test in my app but as soon as the simulator launches I get:
The bundle “AppUITests” couldn't be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2018-10-05 11:04:59.772078-0500 AppUITests-Runner[53273:1645870] (dlopen_preflight(/Users/John/Library/Developer/Xcode/DerivedData/app-ios-client-ewtlrcqcxoeiaudgmthymuhcuxfz/Build/Products/Debug-iphonesimulator/AppUITests-Runner.app/PlugIns/AppUITests.xctest/AppUITests): Library not loaded: #rpath/libswiftSwiftOnoneSupport.dylib
Referenced from: /Users/John/Library/Developer/Xcode/DerivedData/app-ios-client-ewtlrcqcxoeiaudgmthymuhcuxfz/Build/Products/Debug-iphonesimulator/AppUITests-Runner.app/PlugIns/AppUITests.xctest/Frameworks/Alamofire.framework/Alamofire
Reason: image not found)
My UITest is the template created by Xcode 10, I'm using Cocoapods 1.5.3 and Swift 4.2
My project structure:
Workspace
Custom Framework (The Podfile is here)
App A (Here I'm running the UITests)
App B
My podfile looks like this:
platform :ios, '10.0'
inhibit_all_warnings!
use_frameworks!
target 'App Library' do
use_frameworks!
pod 'Intercom'
pod 'Spreedly'
pod 'Alamofire'
pod 'IGListKit'
pod 'CardIO'
pod 'SwiftKeychainWrapper'
pod 'OneTimePassword', :git => 'https://github.com/john/OneTimePassword.git', :branch => 'develop'
pod 'SnapKit'
pod 'DateToolsSwift'
pod 'BetterSegmentedControl'
pod 'SDWebImage'
pod 'SwiftLocation'
pod 'Nuke'
pod 'Instabug'
pod 'Mixpanel-swift'
target 'App LibraryTests' do
inherit! :search_paths
# Pods for testing
end
target 'App' do
project '../App/App'
inherit! :complete
use_frameworks!
pod 'FacebookCore'
pod 'FacebookLogin'
target 'AppTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'App Business' do
project '../App Business/App Business'
inherit! :complete
use_frameworks!
target 'App BusinessTests' do
inherit! :search_paths
# Pods for testing
end
target 'App BusinessUITests' do
inherit! :search_paths
# Pods for testing
end
end
end
# The UI Test target I'm trying to run
target 'AppUITests' do
inherit! :search_paths
use_frameworks!
# Pods for testing
project '../App/App'
pod 'Intercom'
pod 'Spreedly'
pod 'Alamofire'
pod 'IGListKit'
pod 'CardIO'
pod 'SwiftKeychainWrapper'
pod 'OneTimePassword', :git => 'https://github.com/john/OneTimePassword.git', :branch => 'develop'
pod 'SnapKit'
pod 'DateToolsSwift'
pod 'BetterSegmentedControl'
pod 'SDWebImage'
pod 'SwiftLocation'
pod 'Nuke'
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'Instabug'
pod 'Mixpanel-swift'
end
workspace '../app-ios-client'
I have tried putting the UI test target inside the target app with !inherit:complete and !inherit:search_paths, moving it outside like in the code posted above. I have also cleaned the build folders, deleted derived data and restarted Xcode and I still have this problem. I have also tried adding import UIKit and import Alamofire and nothing has worked. Between all this possible fixes I have run pod deintegrate followed by pod install. I think the problem may be related to the podfile being inside my custom framework but honestly I have no idea. Any ideas? Thank you!
My fix was similar to https://stackoverflow.com/a/54034832/883413 except I didn't bother with the post_install section.
Previously my podfile structure was similar to that in the question:
platform :ios, '10.0'
target 'AppName' do
use_frameworks!
pod 'PodName'
target 'AppNameTests' do
inherit! :search_paths
end
target 'AppNameUITests' do
inherit! :search_paths
end
end
Changing it to (the newer?) structure like this resolved the issue:
platform :ios, '10.0'
use_frameworks!
def all_pods
pod 'PodName'
end
target 'AppName' do
all_pods
end
target 'AppNameTests' do
inherit! :search_paths
all_pods
end
target 'AppNameUITests' do
inherit! :search_paths
all_pods
end
I fixed it by changing that target in my podfile to this:
target 'AppUITests' do
inherit! :search_paths
use_frameworks!
# Pods for testing
project '../App/App'
end
Try beside of adding inherit! :search_paths
also changing ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES in post_install
use_frameworks!
def shared_pods
pod 'SomePod'
end
target 'App_name' do
shared_pods
end
target 'App_nameTests' do
inherit! :search_paths
shared_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
end
end
end
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'FoodTracker' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for FoodTracker
target ‘FoodTrackerTests’ do
inherit! :search_paths
# Pods for testing
end
source 'https://github.com/CocoaPods/Specs.git'
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'GoogleMaps'
pod 'GooglePlaces'
end
end
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'FoodTracker' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
# Pods for FoodTracker
pod 'GoogleMaps'
pod 'GooglePlaces'
end
target ‘FoodTrackerTests’ do
inherit! :search_paths
# Pods for testing
end
Since migrating our code base to Swift 3 using Xcode 8 we've been unable to get our unit tests to run. The app compiles and archives fine for the store, but when we try to run tests it fails to build complaining of:
framework not found GoogleMapsBase for architecture x86_64
I've checked our podfile and everything appears to be set correctly according to the latest documentation.
Edit: Podfile below
source 'https://github.com/CocoaPods/Specs.git'
target "Borked" do
platform :ios, '9.3'
use_frameworks!
pod 'GoogleMaps'
pod 'GoogleAnalytics'
target "Unit Tests" do
inherit! :search_paths
end
target "UI Tests" do
inherit! :search_paths
end
end
Something like this should work!
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.3'
use_frameworks!
target 'MyApp' do
pod 'GoogleMaps'
pod 'GoogleAnalytics'
target "Unit Tests" do
inherit! :search_paths
end
target "UI Tests" do
inherit! :search_paths
end
end
or this
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.3'
use_frameworks!
target 'MyApp' do
target 'MyExtension' do
pod 'GoogleMaps'
pod 'GoogleAnalytics'
target "Unit Tests" do
inherit! :search_paths
end
target "UI Tests" do
inherit! :search_paths
end
end
end