OBJC_META_CLASS Issue - ios

Hi Team i am using following pod file in my single view application project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'projectbase' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for projectbase
target 'projectbaseTests' do
inherit! :search_paths
pod 'AFNetworking'
pod 'LGSideMenuController'
pod 'SDWebImage'
pod 'MBProgressHUD'
end
target 'projectbaseUITests' do
inherit! :search_paths
# Pods for testing
end
end
But As i am using "LGSideMenuController" in viewcontroller.h i am getting the Meta class error following is the code and screen shot of error
#import <UIKit/UIKit.h>
#import <LGSideMenuController.h>
#interface ViewController : LGSideMenuController
#end
Compilation with following line is OK
#import <LGSideMenuController.h>
But as i used
#interface ViewController : LGSideMenuController
error occurred
Can any one please help me to resolve this issue
Xcode version is 8.3.2

Please replace pod file with following code.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'projectbase' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'AFNetworking'
pod 'LGSideMenuController'
pod 'SDWebImage'
pod 'MBProgressHUD'
target 'projectbaseTests' do
inherit! :search_paths
end
target 'projectbaseUITests' do
inherit! :search_paths
# Pods for testing
end
end

Related

Upgrade to FirebaseCrashlytics and 'No such module FirebaseCrashlytics'

I am trying to upgrade to FirebaseCrashlytics from Crashlytics. I am able to import Firebase but not FirebaseCrashlytics. Here is my podfile:
platform :ios, :deployment_target => "9.0"
def shared_pods
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'SVProgressHUD'
pod 'IGHTMLQuery'
pod 'OpenTok', '~> 2.16.3'
end
target 'MyApp' do
#use_frameworks!
shared_pods
end
I cannot uncomment use_frameworks! since it breaks other pods I am already using.
My bridging header:
#import "FirebaseCrashlytics/FirebaseCrashlytics.h"
#import "FirebaseCore/FirebaseCore.h"
This is what I am getting:
According to the firebase docs then you just have to import Firebase, not FirebaseCrashlytics.
https://firebase.google.com/docs/crashlytics/get-started?platform=ios
If you're using it as a Swift framework then make sure you add it to your target's Frameworks, Libraries, and Embedded Content

swift linker command failed with exit code 1 Google Maps iOS Util pod install

My build failed with swift linker command failed with exit code 1. The logs specifically say symbol(s) not found for architecture x86_64
This happened ever since I tried setting up Google-Maps-iOS-Utils.
This is my Podfile. There is a pre_install portion because without it, pod install will have a 'Pods-Project' target has transitive dependencies that include static binaries error.
# platform :ios, '9.0'
target 'My App' do
use_frameworks!
platform :ios, '11.3'
# Pods for My App
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils' #the new pod that caused issues
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FirebaseUI/Storage'
pod 'Fabric', '~> 1.7.9'
pod 'Crashlytics', '~> 3.10.5'
target 'My AppTests' do
inherit! :search_paths
# Pods for testing
end
end
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
This is my Bridging-Header.h
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import <Google-Maps-iOS-Utils/GMUMarkerClustering.h>
#endif /* Bridging_Header_h */
Some troubleshooting measures I tried:
Cleaning Build Folder and Building again;
de-integrating pods and pod installing again.
Any help is appreciated. Thanks.
This solution worked for me. There is no need for this portion in the Podfile as well.
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
I also had to delete the framework the binary search path in Build Phases.
Try to add library location in binary search path of build setting.

Xcode 10 UI Tests Reason: Image Not Found with Cocoapods

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

I got error message Unable to find a target named `YOUR_APPLICATION_TARGET_NAME_HERE`, did find `FoodTracker` and `FoodTrackerTests`. how

# 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

iOS unit tests fail on CocoaPods Google Maps SDK

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

Resources