Tesseract "_OBJC_CLASS_$_G8Tesseract", referenced from: - ios

<<< xcode linker error message >>>
"_OBJC_CLASS_$_G8Tesseract", referenced from:objc-class-ref in CalendarViewController.o
ld: symbol(s) not found for architecture x86_64
<<< import header file >>>
import "TesseractOCRiOS/TesseractOCR/TesseractOCR.h"
<<< podfile >>>
platform :ios, '9.0'
target 'toeicMap' do
pod 'TesseractOCRiOS', :git => 'https://github.com/gali8/Tesseract-OCR-iOS.git'
end
<<< pod install message >>>
hirata-MacBook-Pro:myMap+pod hirata$ pod install
Analyzing dependencies
Downloading dependencies
Installing TesseractOCRiOS 4.0.0 (was 3.4.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] The toeicMap [Debug] target overrides the CLANG_CXX_LIBRARY build setting defined in Pods/Target Support Files/Pods-toeicMap/Pods-toeicMap.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the$(inherited)` flag, or
- Remove the build settings from the target.
[!] The toeicMap [Release] target overrides the CLANG_CXX_LIBRARY build setting defined in Pods/Target Support Files/Pods-toeicMap/Pods-toeicMap.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the$(inherited)` flag, or
- Remove the build settings from the target.
hirata-MacBook-Pro:myMap+pod hirata$
<<< Target Support Files/Pods-toeicMap/Pods-toeicMap.debug.xcconfig >>>
CLANG_CXX_LIBRARY = compiler-default
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TesseractOCRiOS"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TesseractOCRiOS" $(inherited) "${PODS_ROOT}/TesseractOCRiOS/TesseractOCR/lib"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TesseractOCRiOS"
OTHER_LDFLAGS = $(inherited) -ObjC -weak_library /usr/lib/libstdc++.6.0.9.dylib -l"TesseractOCRiOS" -l"lept" -l"stdc++" -l"tesseract_all" -framework "Foundation" -framework "UIKit"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods
pod version = 1.0.1
Any help is appreciated!

Related

Change Other Swift Flags gives build error

I'm creating multiple targets for development, test, production, QA etc.. When I do that I want to differentiate this targets by changing "other swift flags". As default, It shows as in below screenshot.
I want to change that "-D" to "Prod". I think because I use Cocoapods, I'm getting build error. My Pods xcconfig file is in below;
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '#executable_path/Frameworks' '#loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
I'm getting below error
:0: error: unknown argument: '-PROD'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
When you are adding processor macros you have to define them with the prefix -D so, in your need to add -DPROD, like this

Linker Command Failed after updating cocoapods

I had a project that was working fine and I decided to update cocoapods. I ran
pod install after cocoapods updated, and now I'm getting this error:
ld: library not found for -lStripe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know this is a common cocoapods error/problem. I've scoured the internet for the last 12 hours trying every possible solution. Things I've done:
Made sure I'm opening the workspace
Reinstalled cocoapods
Downgraded cocoapods to a previous version (to 0.33.1)
Ran deintegrate and removed cocoapods
Reinstalled cocoapods again
Made sure Build Active Architecture Only is set to NO on both Pod and Target
Tried many variations for Other Linker Flags (see below for current setup)
My Framework Search Paths and Library Search Paths each start with $(inherited)
Other Linker Flags
$(inherited)
-framework
"CoreGraphics"
-framework
"Foundation"
-framework
"MobileCoreServices"
-framework
"Security"
-framework
"SystemConfiguration"
Sometimes, with the above Linker Flags, if I rerun pod install I get a bunch of arm64 errors which can only be solved by adding this to the linkers:
-l"Pods-Buyer-AFNetworking"
-l"Pods-Buyer-Stripe"
-l"Pods-Buyer-RKNotificationHub"
-l"Pods-Buyer-RKDropdownAlert"
-l"Pods-Buyer-SVProgressHUD"
I've also tried combinations of adding/removing this from the Linker Flags:
-ObjC
-lc++
-all_load
And finally, here's my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
target 'Buyer' do
pod 'AFNetworking', '2.2.1'
pod 'Stripe'
# pod 'PaymentKit'
pod 'RKNotificationHub'
pod 'RKDropdownAlert'
pod 'SVProgressHUD'
# pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'BuyerTests' do
end
I've also followed all of the steps on the CocoaPods Guides Troubleshooting page (specifically 'Using the CocoaPods Project' > Step 4). That didn't change anything.
Is there anything I'm missing? This is driving me crazy... I'm at wits end. Any advice or things I'm missing would be really appreciated! (Oh and I'm running the latest Xcode version)
Thank you all in advanced!

ld: framework not found AFNetworking

I get linking error when trying to compile iOS project from terminal with Xcode 7.1.1:
xcodebuild -project MyProject.xcodeproj -configuration Debug -target MyProject build
As result I receive next error:
ld: framework not found AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my pod file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target "MyProject" do
pod "AFNetworking", "~> 2.0"
pod 'GoogleMaps'
pod 'MONActivityIndicatorView'
pod 'NYXImagesKit'
pod 'MagicalRecord'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'Countly'
end
xcodeproj 'MyProject'
I also tried adding link_with but get the same error. How to fix the problem above?
You need to build using the workspace generated by CocoaPods:
xcodebuild -workspace MyProject.xcworkspace -configuration Debug -scheme MyProject build
If you build just the project, xcodebuild does not see the dependency on the Pods project. Note that you have to use a scheme when building a workspace rather than a target. This means if you are building on a build server you will need to mark your scheme as shared in the scheme editor.

Cocoapods <RestKit/RestKit.h> not found

I have a really hard time install RestKit into my project using CocoaPods. I get the not found error.
My Pods.xcconfig looks like this:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/AFNetworking" "${PODS_ROOT}/Headers/ISO8601DateFormatterValueTransformer" "${PODS_ROOT}/Headers/RKValueTransformers" "${PODS_ROOT}/Headers/RestKit" "${PODS_ROOT}/Headers/RestKit/CoreData" "${PODS_ROOT}/Headers/RestKit/Network" "${PODS_ROOT}/Headers/RestKit/ObjectMapping" "${PODS_ROOT}/Headers/RestKit/Support" "${PODS_ROOT}/Headers/SDWebImage" "${PODS_ROOT}/Headers/SOCKit" "${PODS_ROOT}/Headers/SSKeychain" "${PODS_ROOT}/Headers/SVProgressHUD" "${PODS_ROOT}/Headers/TTTAttributedLabel" "${PODS_ROOT}/Headers/TransitionKit" "${PODS_ROOT}/Headers/Vendor/LibComponentLogging/Core" "${PODS_ROOT}/Headers/Vendor/LibComponentLogging/NSLog"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers" -isystem "${PODS_ROOT}/Headers/AFNetworking" -isystem "${PODS_ROOT}/Headers/ISO8601DateFormatterValueTransformer" -isystem "${PODS_ROOT}/Headers/RKValueTransformers" -isystem "${PODS_ROOT}/Headers/RestKit" -isystem "${PODS_ROOT}/Headers/RestKit/CoreData" -isystem "${PODS_ROOT}/Headers/RestKit/Network" -isystem "${PODS_ROOT}/Headers/RestKit/ObjectMapping" -isystem "${PODS_ROOT}/Headers/RestKit/Support" -isystem "${PODS_ROOT}/Headers/SDWebImage" -isystem "${PODS_ROOT}/Headers/SOCKit" -isystem "${PODS_ROOT}/Headers/SSKeychain" -isystem "${PODS_ROOT}/Headers/SVProgressHUD" -isystem "${PODS_ROOT}/Headers/TTTAttributedLabel" -isystem "${PODS_ROOT}/Headers/TransitionKit" -isystem "${PODS_ROOT}/Headers/Vendor/LibComponentLogging/Core" -isystem "${PODS_ROOT}/Headers/Vendor/LibComponentLogging/NSLog"
OTHER_LDFLAGS = -ObjC -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration
PODS_ROOT = ${SRCROOT}/Pods
Podfile like so:
platform :ios, '7.0'
pod 'TTTAttributedLabel'
pod 'SVProgressHUD', :head
pod 'SDWebImage', '~>3.6'
pod 'SSKeychain'
pod 'RestKit', '0.23.1'
My Project settings in in the other linker flags includes:
$(inherited)
And the header search paths does also include:
$(inherited)
"$(BUILT_PRODUCTS_DIR)/../../Headers"
My target configuration is like so:
How can I fix this issue?
In my case this issue was related to pods configuration.
Step to resolve.
IMP: Backup your project before doing any configuration changes.
Find the file where the variable PODS_ROOT is defined in your project. It will be defined under Pods-<Project Name>.debug.xcconfig and Pods-<Project Name>.release.xcconfigfiles.
Reveal/Show both files in Finder , it will be under the folder /Pods/Target Support Files/Pods-<Project Name>/
Delete both files from your project (DO NOT trash, only remove the reference)
Now from your project navigator , open build-debug.xcconfig
Replace the following line ,
#include "../pods-debug.xcconfig"
with the following line,
#include "../Pods-<Your Project Name>.debug.xcconfig"
and in build-release.xcconfig replace the following line ,
#include "../pods-release.xcconfig"
with the following line,
#include "../Pods-<Your Project Name>.release.xcconfig"
Replace the original file pods-debug.xcconfig and pods-release.xcconfig files under your project folder with the files Pods-<Your Project Name>.debug.xcconfig and Pods-<Your Project Name>.release.xcconfig respectively from the folder /Pods/Target Support Files/Pods-<Project Name>/.
Add back the new configuration files Pods-<Your Project Name>.debug.xcconfig and Pods-<Your Project Name>.release.xcconfig to your project.
Confirm both your project and target is referring to pods-debug.xcconfig/pods-release.xcconfig (Select Project File then select 'info' tab, under that expand 'Configurations')
Confirm 'Build Settings/Header Search Paths' contains $(inherited)
Reopen your project and do a clean build.
Explaining the issue
The pod configuration was not properly loaded to your project , to test this you can simply add "$(PODS_ROOT)/test" under 'Build Settings/Header Search Paths', you can see it is resolving to '/test' , that means the variable PODS_ROOT was not defined and hence it is resolving to empty string. That means the config file where PODS_ROOT is defined not loaded to project settings. Now check the config file set in your Xcode project (Select Project File then select 'info' tab, under that expand 'Configurations') it is referring to build.xcconfig and build-debug.xcconfig/build-release.xcconfig. These files includes the pod config files, but the included config files pods-debug.xcconfig/pods-release.xcconfig doesn't contain the required pod config details. So, now we replaced this with correct config file. You can also try copy paste the content of config files so that we can avoid replacing the files.

CocoaPods generates invalid project file (header not found)

I have a project file with a Podfile that looks like this:
platform :ios, '7.0'
def import_pods
pod 'Specta', '0.1.8'
pod 'Expecta', '0.2.1'
pod 'RestKit', '0.20.3'
pod 'MagicalRecord', '2.1'
pod 'RestKit/Testing', '0.20.3'
end
link_with 'LocalMedTests'
import_pods
When I run pod install, it generates the Podfile.lock, Pods directory, and workspace for my project. When I open the workspace to build it, I get errors like this: 'RestKit.h' file not found.
It seems to only be an issue for RestKit but I can't get past those errors to see if there are more. The restkit headers are in Pods/Headers. They're properly included in Pods.xcconfig. Here it is for good measure:
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/AFNetworking" "${PODS_ROOT}/Headers/Expecta" "${PODS_ROOT}/Headers/MagicalRecord" "${PODS_ROOT}/Headers/RestKit" "${PODS_ROOT}/Headers/RestKit/RestKit" "${PODS_ROOT}/Headers/RestKit/RestKit/CoreData" "${PODS_ROOT}/Headers/RestKit/RestKit/Network" "${PODS_ROOT}/Headers/RestKit/RestKit/ObjectMapping" "${PODS_ROOT}/Headers/RestKit/RestKit/Support" "${PODS_ROOT}/Headers/RestKit/RestKit/Testing" "${PODS_ROOT}/Headers/SOCKit" "${PODS_ROOT}/Headers/Specta" "${PODS_ROOT}/Headers/TransitionKit"
OTHER_LDFLAGS = -ObjC -framework CFNetwork -framework CoreData -framework Foundation -framework MobileCoreServices -framework Security -framework SenTestingKit -framework SystemConfiguration
PODS_ROOT = ${SRCROOT}/Pods
I've tried cleaning and cleaning the build folder. It doesn't matter - I always get the header not found error.
I should also add that all of the header directories specified by Pods.xcconfig are included in the target as they should be.
Any ideas about this? I've been using CocoaPods in this project for a couple of months with no issue, did something change recently?
This solved my Problem
In HEADER_SEARCH_PATHS Under your Project Build Setting add the $(inherited)
Also DO this for all TAGETS
Change Arcgitectures to Standard armv7
https://stackoverflow.com/a/12142790/1294448
For me, the problem was with Other Linker Flags and Runpath Search Paths, which weren't inheriting the settings defined on xcconfig. The following adjustments solved my problem:
Other Linker Flags:
$(inherited)
Runpath Search Paths:
$(inherited)
#executable_path/Frameworks

Resources