iOS App, Objective-C: Weird Podfile - ios

I am trying to get a app running which was written by some guys some years ago. Instead of a Podfile, the app had a file called SBPodfile with the following content:
#platform :ios, "8.0"
#use_frameworks!
target '------' do
pod 'ZCSFileExtensionForMimeType', :git => 'https://github.com/----/ZCSFileExtensionForMimeType.git'
pod 'AMSlideMenu', '~> 1.5.4'
pod 'SSKeychain'
pod 'SVProgressHUD', '~> 1.1'
SB_PODS_START
ObjCSBLog
ObjCSBDeviceHelper
ObjCSBSynthesizeSingleton
ObjCSBFileHandler
ObjCSBImageCreationHelper
ObjCSBAlertViewHelper
SB_PODS_END
end
target 'actionExtension' do
pod 'ZCSFileExtensionForMimeType', :git => 'https://github.com/-----/ZCSFileExtensionForMimeType.git'
pod 'SSKeychain'
pod 'UAProgressView', '~> 0.1'
SB_PODS_START
ObjCSBLog
ObjCSBDeviceHelper
ObjCSBSynthesizeSingleton
ObjCSBFileHandler
SB_PODS_END
end
target '-----' do
end
The app wouldn't compile because there was no Podfile. So I renamed the SBPodfile to Podfile. Now I am getting the error that the constant "SB_PODS_START" is not defined. I couldn't find out anything about that weird "SB block" on google. Does anyone have a clue what it is.
I have to add that I am relatively new to iOS development, especially in objective c.
Edit: I think that SB stands for the Company which developed the App and they are loading some custom libraries. But I still don't know how it works.

Related

iOS - Add Swift pod to Objective-C project

Hello I'm working on an old Objective-C project, that has 30+ pods dependecies, all written in Objective-C.
I'm trying to add a Swift pod, this one in particular :
pod 'CSV.swift', '~> 2.4.3'
# ...
# other Objective-C pods ...
# ...
Because I would like to continue new developments in Swift.
But I cannot make it work. If I add use_frameworks!, I get an error at pod install :
The 'Pods-myProject' target has transitive dependencies that include static binaries: (/myProjectPath/Pods/ObjcPod/ObjcPod.framework)
And if I remove use_frameworks!, I get tons of compilation errors, here are some :
Undefined symbol: protocol descriptor for Swift.UnicodeCodec
Undefined symbol: dispatch thunk of Swift.UnicodeCodec.decode<A where A1: Swift.IteratorProtocol, A.CodeUnit == A1.Element>(inout A1) -> Swift.UnicodeDecodingResult
I don't know what I could try otherwise, any help would be much appreciated !
This way you can use swift pod in objective c project try this solution.
Write in your pod file
target 'YourProjectName' do
use_frameworks!
pod 'CSV.swift', '~> 2.4.3'
// Here you can add mode pod as per your requirement Like
pod 'Firebase/Core'
pod 'Fabric'
pod 'Crashlytics'
end
Then Run Pod Install.
For import write this
#import CSV;
And then you have access of your CSV pod files.

ReactNative 0.59.8 project - unable to archive for for iOS while app store release

We recently upgraded all libraries in Our ReactNative App and we are using RN v0.59.8 and XCode v 10.3 (10G8), everything worked fine, we are able to build and run the app with development certificate and even distribution certificate with Adhoc profile.
However, when we tried to submit to the app store, after archive, the app is always listed under Other Items, rather than under iOS apps. the type of archive is always showing as Generic Xcode archive which is wrong.
when we checked why Validate and upload to app store buttons are disabled, we found apple technical document
as per the suggestion is given in the document, we followed the following steps:
make skip install No for all static libraries under build settings
move all header files from Headers build phase to Copy files build phase
the second step is a little tedious job because we have to manually do for all static libraries.
after doing so, we started getting plenty of compilation errors like Redefinition for MethodDescriptor in NativeModule.h
See errors ->
there are more than 600+ errors of that kind.
Kindly help me to resolve this issue
Here is my Pod File
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
#use_frameworks!
target 'SociallyGood' do
# this is very important to have!
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'ART',
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'DevSupport'
]
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# pod 'GoogleMaps' # <~~ remove this line if you do not want to support GoogleMaps on iOS
# Pods for SociallyGood
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # If you need GoogleMaps support on iOS
# pod 'GoogleAppMeasurement', '5.4'
pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'RNShare', :path => '../node_modules/react-native-share'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'GoogleSignIn', '~> 4.4.0'
# pod 'GoogleUtilities', '~> 1.3'
# pod 'GoogleAuthUtilities'
# pod 'GoogleAppUtilities'
pod 'FacebookSDK'
pod 'FBSDKCoreKit', '~> 4.40.0'
pod 'FBSDKLoginKit', '~> 4.40.0'
pod 'FBSDKShareKit', '~> 4.40.0'
# Required by RNFirebase
pod 'Firebase/Core', '~> 5.20.2'
pod 'Firebase/Auth', '~> 5.20.2'
# very important to have, unless you removed React dependencies for Libraries
# and you rely on Cocoapods to manage it
# pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
pod 'BugsnagReactNative', :path => '../node_modules/bugsnag-react-native'
# pod 'react-native-maps', :path => '../node_modules/react-native-maps'
# pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
end
I had this same struggle when trying to release my first RN app to the app store. My archived build always was listed under the "Other items"
It took me awhile to find an answer, but this is what I do now:
There is another way to upload your app build to the app store: by creating an .ipa file of your app, and uploading it through Application Loader in Xcode.
I don't remember all the resources I found that helped me figure this out, but this was one of them: How to build .ipa application for react-native-ios?
Essentially, after you do the Clean Build Folder, and then Build, you find the .app file in:
~/Library/Developer/Xcode/DerivedData//Build/Products/Release-iphoneos/
Create a new folder on your desktop named Payload (this name is case-sensitive)
Copy your .app file and paste the copy in this Payload folder.
Right click the folder and choose "Compress Payload"
When you save this, do not save it with the .zip extension, but instead save it with a .ipa extension.
This is now your .ipa file for your app, and you can upload this through Xcode Application Loader.
The upload process will tell you if there is anything wrong with your build, but if there is not, it will upload to the app store and you should be able to find it in App Store Connect in a few moments.
Hope this helps you and/or others!

Please add the host targets for the embedded targets to the Podfile

My project is in Swift 2.0. I am try all possible ways but not found any solution.
My pod file
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, :deployment_target => '8.0'
# ignore all warnings from all pods
inhibit_all_warnings!
use_frameworks!
def available_pods
pod 'IQKeyboardManager'
pod 'Instabug'
pod "TSMessages"
pod 'AsyncSwift' , :git => 'https://github.com/duemunk/Async.git'
pod 'Onboard' # not used
pod 'DZNEmptyDataSet' # not used
pod 'iOS-Slide-Menu'
pod 'Kanna', :git => 'https://github.com/tid-kijyun/Kanna.git'
pod 'HanekeSwift', :git => 'https://github.com/Haneke/HanekeSwift.git'
pod 'Alamofire'
pod 'ObjectMapper', :git => 'https://github.com/Hearst-DD/ObjectMapper.git'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'ReachabilitySwift'
pod 'SCLAlertView'
pod 'ImageLoader'
pod 'NVActivityIndicatorView', :git => 'https://github.com/ninjaprox/NVActivityIndicatorView.git'
pod 'ActiveLabel'
pod 'MWFeedParser'
pod "SwiftElegantDropdownMenu"
pod 'SwiftHEXColors'
pod 'UITextView+Placeholder'
pod "AFDateHelper"
pod 'DateTools'
pod "SwiftDate", "~> 2.0"
pod 'APAddressBook/Swift'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'PusherSwift', git: 'https://github.com/pusher/pusher-websocket-swift.git', branch: 'push-notifications'
end
def available_pods_exc
pod 'Alamofire'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'ReachabilitySwift'
pod 'Kanna', :git => 'https://github.com/tid-kijyun/Kanna.git'
pod 'AsyncSwift' , :git => 'https://github.com/duemunk/Async.git'
end
target 'link' do
available_pods
end
target 'ReadLaterExtension' do
available_pods_exc
end
target 'Link Tests' do
pod 'Quick', '0.3.1'
pod 'Nimble'
end
I found below error
[!] Unable to find host target(s) for ReadLaterExtension. Please add the host targets for the embedded targets to the Podfile.
Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)
The problem is not in the podfile, but in the project!
To fix:
Go to XCode
Select your HOST target.
Open the target's 'General' page
In the 'Embedded Binaries' section, make sure your EXTENSION target is present.
In your Podfile you should have:
target 'HostApp' do
....
target 'YourExtension' do
....
end
end
In order to disable building/running the NSExtension you build, you should:
Click the project file in the project navigator
Click the containing app target (the one you DO want to run)
Click Build Phases tab
Open Target Dependencies
Remove the extension (the one you DON'T want to run)
To bring it back, simply click the + sign in the same place and
re-add it.
In my case working sucessfully
For future reference I would like to add one reason I just discovered for this error message:
In the Main Targets Build Phases the section Embed App Extensions has to be above the [CP] Copy Pods Resources and [CP] Embed Pods Frameworkds.

Error ITMS-90206 Invalid bundle contains disallowed file 'Frameworks'

I have a problem uploading my application into the Store via Xcode, this one in particular.
I saw a lot of post about this error, but all are talking about Extension App, that I do not use.
I'm using a Custom framework and Cocoapods.
You can see here my tree :
XXX is my project app name
SharedXXX is my custom framework
Pods is the project created by cocoa pods
Here is my cocoa podFile :
use_frameworks!
link_with 'XXX', 'SharedXXX'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
workspace 'XXX'
xcodeproj 'XXX/XXX.xcodeproj'
xcodeproj 'Shared/SharedXXX.xcodeproj'
def default_pods
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod "SnapKit", '~> 0.17.0'
pod "DKChainableAnimationKit", '~> 1.6.0'
pod "AsyncSwift"
end
def shared_pods
pod "Alamofire", '~> 3.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'ReachabilitySwift', :git => 'https://github.com/ashleymills/Reachability.swift'
end
target :XXX do
xcodeproj 'XXX/XXX.xcodeproj'
default_pods
shared_pods
end
target :XXXDev do
xcodeproj 'XXX/XXX.xcodeproj'
default_pods
shared_pods
end
target :SharedXXX do
xcodeproj 'Shared/SharedXXXX.xcodeproj'
shared_pods
end
Build settings for custom framework (SharedXXX) :
I set the Embedded property to Yes
General Settings for custom framework (SharedXXX) :
The framework provided by Cocoapods is linked.
And to finish,
The General Settings to the main project (App Project : called XXX on the tree)
:
Any idea ?
I solved the problem
Firstly, set into Build Settings
For main project (here XXX) : Embedded Content Contains Swift Code to
YES
Custom Framework (SharedXXX) : Embedded Content Contains Swift Code to NO
Custom Framework (SharedXXX) : Runpath Search Path = #executable_path/../../Frameworks
This helped me solving that issue
I faced the same problem while trying to upload from Xcode 9.3
This happened because I added 'use_frameworks' in my OneSignal
NotificationServiceExtension
The value Always Embed Swift Standard Libraries found in Build Settings should be set to Yes only for you main Projects and not for your custom frameworks or extensions.

NewRelicAgent does not work with OCTesting

I have a problem with the NewRelicAgent pod.
It works fine with the nomral app targed und runs well in the simulator, but as soon as I start the test target, I get the the following error message:
ld: framework not found NewRelicAgent
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My pod file looks like this:
platform :ios, '5.0'
pod 'RestKit', '~> 0.20.0rc'
pod 'RestKit/Testing', '~> 0.20.0rc'
pod 'RestKit/Search', '~> 0.20.0rc'
target :test do
link_with :DealiniTests
pod 'Expecta', '0.2.1'
end
pod 'GoogleAnalytics-iOS-SDK', '~> 2.0beta4'
pod 'NewRelicAgent', '~> 1.328.0'
pod 'Parse', '~> 1.2.9'
I think the problem is, that the PATHS links to a path "{PODS_ROOT}/BuildHeaders/NewRelicAgent" which does not exsits.
I have no NewRelicAgent folder in the Headers and BuildHeaders folder but it does work for the normal target just for the test target not.
All other pods works fin just the newrelic does not work.
The Problem is, that CocoaPods does not automaticly add the NewRelic framework to the
FRAMEWORK_SEARCH_PATHS
I just added "$(PODS_ROOT)/NewRelicAgent/NewRelic_iOS_Agent_1.328" to the FRAMEWORK_SEARCH_PATHS of the test target and it worked
I am not sure if this would be a good solution, but try to add pod 'NewRelicAgent', '~> 1.328.0' to your test target as well. I did that in order to be able to use RestKit classes in my tests. The only difference is that I have my test target declared as exclusive in my podfile.
try adding $(FRAMEWORK_SEARCH_PATHS) to your "Framework Search Paths" in the test target build settings. It appears cocoapods doesn't set up the headers and search paths correctly for this particular pod.

Resources