how to add cocos2d together with AFNetworking in Xcode - ios

My project start with cocos2d v3 and run smooth. However, when I add AFNetworking to my project,
the problem
"ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)" happen.
I used pod install and pod file is
platform :ios, ‘7.0’
pod 'AFNetworking', '~> 2.0'
during the installing, below messages show out
[!] The abc [Debug] target overrides the HEADER_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
[!] The abc [Release] target overrides the HEADER_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
so I go to project->target->build setting-> header search paths and put $(inherited) inside, then it can install success.
However, the cocos2d library wasn't call. So I go to Pods.debug.xcconfig and Pods.release.xcconfig to add
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/kazmath/include" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/Chipmunk/chipmunk/include" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/Chipmunk/objectivec/include"
finally the problem "ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)" still happen.
Are the above steps not correct? Or is there any other way to add cocos2d and AFNetworking together? Thank you.

Related

ld: library not found for -lADEUMReactNative

I just create React Native project (0.64.1)
and I install appDynamic (21.4)
This is the version I found in my package.json
"#appdynamics/react-native-agent": "^21.4.0",
"appdynamics": "20.7.0",
How, about when I try to run the application on iOS device,
here is the error message I got:
ld: library not found for -lADEUMReactNative
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried the following method:
remove the Library Search Path
change the path of libADEUMReactNative.a under "Link Binary With Libraries" of "Build Phases"
which method I can tried? thank you
Make sure the pod version and the IOS deployment target is >= 11.
Then do pod install and build your project.

Setting up Google SSO with Podfile in Swift

I am trying to set up Google SSO.
My Podfile looks like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Recreation-iOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Google SSO
pod 'GoogleSignIn'
# Pods for Recreation-iOS
target 'Recreation-iOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'Recreation-iOSUITests' do
# Pods for testing
end
end
Then in Terminal I ran pod install from inside the repo, but I get an error when I run it:
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
- missing compatible arch in ...
https://github.com/CocoaPods/CocoaPods/issues/10541 [open] [3 comments]
4 weeks ago
- I got error when doing pod install, something to do with M1 chip
https://github.com/CocoaPods/CocoaPods/issues/10569 [open] [2 comments]
a week ago
- CocoaPods compatibility with Apple DTK (Apple Silicon)
https://github.com/CocoaPods/CocoaPods/issues/9907 [open] [105 comments]
a day ago
and 3 more at:
https://github.com/cocoapods/cocoapods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C%200x0009%29%3A%20missing%20compatible%20arch%20in%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%20-%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues&utf8=✓
[!] Automatically assigning platform `iOS` with version `14.0` on target `Recreation-iOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`
This error message is not descriptive, so I don't know where to go from here.
--
EDIT: I tried the suggestion below and it seemed to work, but I still cannot get it to compile. Am getting this error now:
linker command failed with exit code 1 (use -v to see invocation)
----------------------------------------
SchemeBuildError: Failed to build the scheme "Recreation-iOS"
linker command failed with exit code 1 (use -v to see invocation)
Build target Recreation-iOS:
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Recreation-iOS editor. (in target 'Recreation-iOS' from project 'Recreation-iOS')
Link Recreation-iOS (arm64):
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: framework not found AppAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run custom shell script '[CP] Embed Pods Frameworks':
mkdir -p /Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/Recreation-iOS.app/Frameworks
/Users/mycomputer/Documents/Git/Recreation-iOS/Pods/Target Support Files/Pods-Recreation-iOS/Pods-Recreation-iOS-frameworks.sh: line 42: source: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
There's a link in the 3rd line of the error message. Following it led to a page with the search string:
dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle
Googling "missing compatible arch" and "2.6.0" led me to this answer (https://github.com/CocoaPods/CocoaPods/issues/10220#issuecomment-730963835):
sudo arch -x86_64 gem install ffi
Then
arch -x86_64 pod install

CocoaPod with debug only dependency fails on xcodebuild

I am working on a private iOS Swift CocoaPod which is supposed to be used for DEBUG builds only. It uses one other CocoaPod as a dependency, which should also be included for DEBUG only. All code in the source files that use this dependency are inside the if #DEBUG swift flag, To achieve this I added it to my PodSpec with the following line:
s.dependency 'OHHTTPStubs/Swift', '~> 9.0', :configurations => :debug
However when I run pod lib lint it fails on Building with `xcodebuild`. step, when I run the lint with --verbose argument I get the following result:
ld: framework not found OHHTTPStubs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
** BUILD FAILED **
The following build commands failed:
Ld /Users/<username>/Library/Developer/Xcode/DerivedData/App-dvhxmheoxqefvffloemufugtmpli/Build/Products/Release-iphonesimulator/<cocoapod_name>/<cocoapod_name>.framework/<cocoapod_name> normal
(1 failure)
When I don't include , :configurations => :debug argument everything works as expected, however when I then add my CocoaPod to my iOS project, this will include the OHHTTPStubs framework in release builds, even when I add my CocoaPod with the , :configurations => :debug argument in the Podfile of my iOS project.

ld: library not found for -lCocoaLumberjack

I updated pods for SalesforceSDKCore 4.3.1 and SalesforceRESTApi 4.3.1. When I did pod install it in turn installed cocoaLumberjack library which is a dependent library I suppose. After successful install of Pods, I couldn't build successfully, as I am getting this error -
ld: library not found for -lCocoaLumberjack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I deleted my Library search paths, added/deleted inerited in Other linker Flags, nothing seem to work. These are my search path and other linker flag settings.
My Pod file -
# platform :ios, '8.0'
target 'Custom' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Custom
source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'SalesforceSDKCore'
pod 'XMLDictionary', '~> 1.4'
pod 'SalesforceNetwork'
pod 'SmartStore'
pod 'SmartSync'
end
I had the same problem. I tried many solutions, some of them are:
File/Workspace Settings/Derived Data Arrow -> Delete DerivedData folder, empty trash
Terminal -> pod deintegrate , pod install
If you renamed your target's name, then:
Target/Build Settings/Test Host :: $(BUILT_PRODUCTS_DIR)/TargetName.app/TargetName
I really hate this linker command failed problem. I get it all the time and every time I need to follow another solution to solve this. I must have given over 30 hours of my life to this s#$t.

VIMNetworking with pod install error

It's possible use this library with pod install?
My project already uses pod install and when I add this library, crash with:
"(UIImageView+AFNetworking.o) ld: 76 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)"
VIMNetworking worked out its Cocoapods issues - see https://github.com/vimeo/VIMNetworking
The Podfile entries that worked for me were
pod 'VIMNetworking', '~>5.4.2'
pod 'VIMVideoPlayer', '~>5.4.2'
and deleting the line for AFNetworking since the VIMNetworking pulls AFNetworking in as a dependecy.

Resources