Lazy symbol binding failed in Xcode 8.3.3 - ios

My Application has deployment target 8.0. It works well with device running above iOS 10.0, but it gets crashed in the device running below iOS 10.0. Here is the error which I got from console
dyld: lazy symbol binding failed: Symbol not found: _sqlite3_key
Referenced from: /var/containers/Bundle/Application/887A192E-F390-47F6-80F3-768F4F321C8A/xxxx.app/xxx
Expected in: dyld shared cache
Below are the things I have tried to fix this, but nothing worked for me
Force Cleaned the application.
Reloaded the console.
Added the following architectures (armv7s, arm64, armv7).
Deleted the libsqlite3.tbd and added once again.
Generating the build with distribution profile and installed the same in device and tried (Gone through in some threads and found it happens only in the DEBUG mode).

Related

Xcode 10 GM libstdc++ error, can't run on simulator

I am trying to test my apps for iOS 12. I have a iPad only app that works fine under Xcode 9. When I try to compile it for the simulator with Xcode 10 GM, the following warning appears:
URGENT: building for iOS Simulator simulator, but linking against dylib (/usr/lib/libstdc++.6.0.9.dylib) built for macOS. Note: This will be an error in the future
It will build, but when running it crashes with the following message:
dyld: lazy symbol binding failed: can't resolve symbol ___cxa_guard_acquire in /Users/.... /.... xxx.app because dependent dylib #1 could not be loaded.
I haven't done anything, it happened on the first try.
Any ideas?
removed '/usr/lib/libstdc++.6.0.9.dylib' from the 'OTHER_LDFLAGS', seems to be fine again.
libstc is removed in iOS 12 and was first deprecated in Xcode 10. You can however manually add this library in Simulator or update your dependency to use libc++.
Refer this link for manually adding these libraries - libstdc

unable to archive react native IOS application

I'm trying to Archive an react native IOS app via Xcode but it fails with the error. The app builds ok and runs on real device and also on simulator normal only the archive fails. The error is the following:
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
/Users/simoncigoj/Library/Developer/Xcode/DerivedData/GoOptiDriverProject-fdekgxtfuwblpfbtjzxjseykeddi/Build/Intermediates.noindex/ArchiveIntermediates/GoOptiDriverProject/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Users/simoncigoj/Library/Developer/Xcode/DerivedData/GoOptiDriverProject-fdekgxtfuwblpfbtjzxjseykeddi/Build/Intermediates.noindex/ArchiveIntermediates/GoOptiDriverProject/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
ld: 168 duplicate symbols for architecture arm64

xctattachment symbol not found when running ios tests on aws device farm

I have an iOS app and a set of unit tests for it (XCTests) and I would like to run these tests on aws device farm on an iOS device. AWS documentation is a bit vague but I found a great post describing steps in detail (http://cleanswifter.com/amazon-device-farm-xctest-tutorial/)
If I don't use XCTAttachment inside a XCTest - everything works fine. However if I want to use it - the app fails to load .xctest bundle with the following error:
2018-03-21 11:28:46.769 Testing[259:6945] The bundle “TestingTests”
couldn’t be loaded. Try reinstalling the bundle.
2018-03-21 11:28:46.770 Testing[259:6945]
(dlopen(/var/containers/Bundle/Application/B59ACE41-3F1F-4209-983D-
415BC47F118B/Testing.app/aatp/test-bundle.xctest/TestingTests, 265):
Symbol not found: _OBJC_CLASS_$_XCTAttachment
Referenced from: /var/containers/Bundle/Application/B59ACE41-3F1F-4209-
983D-415BC47F118B/Testing.app/aatp/test-bundle.xctest/TestingTests
Expected in: /private/var/containers/Bundle/Application/B59ACE41-3F1F-
4209-983D-415BC47F118B/Testing.app/aatp/XCTest.framework/XCTest
in /var/containers/Bundle/Application/B59ACE41-3F1F-4209-983D-415BC47F118B/Testing.app/aatp/test-bundle.xctest/TestingTests)
So for some reason it fails to find XCTAttachment symbol. The same code runs fine on simulator locally. It's a single view app built with XCode 9.2, iOS Deployment target is 10.3.
Has anyone had similar issue?

Xcode 6 Error - "Missing Required Architecture i386" When Building for iOS Simulator

I have created a custom Objective-C framework. I would like to import it into any given iOS project and use its provided functionality on both the iOS Simulator and an actual device. To import the framework, I link it using the Build Phases > Link Binary With Libraries setting in the app's target. I'm then able to import it into one of my classes with this statement:
#import <CustomFramework/CustomFramework.h>
I can instantiate my framework's classes just fine, but when I try to run my project on a device, I get the following error message:
dyld: Library not loaded: #rpath/CustomFramework.framework/CustomFramework
Referenced from: /var/mobile/Applications/A61E882D-481A-4C0B-B4FD-69F5D24968BF/TestApp.app/TestApp
Reason: image not found
And if I try to run it on the simulator, I get a different error message:
ld: warning: ignoring file /Users/user/Desktop/CustomFramework.framework/CustomFramework, missing required architecture i386 in file /Users/user/Desktop/CustomFramework.framework/CustomFramework (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CustomFramework", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This occurs when I instantiate a class from the framework. If I import the framework but don't actually use it, my app builds successfully. It just errors whenever I instantiate a class from the framework for some reason.
To get the app to build on a device, I followed this SO answer. Instead of linking the framework, I added a new Copy Files phase in the target's Build Phases setting, set the Destination to Framework, and added my framework.
That works great; however, I'd like to test my app on the iOS Simulator as well. When I try to run my app on the simulator, I still get the "missing required architecture i386" error. I've tried the solutions proposed at just about every related SO topic I could find, and nothing has helped me resolve this issue.
Please note that I am trying to use my custom framework in a new Xcode project, so none of the app/build settings have been changed from their defaults.
How can I fix this error so that I can run my app on both the iOS Simulator and a device with my framework included in the project? Any insight would be greatly appreciated!
The issue was that the framework was not compiled for the iOS Simulator's architecture, which is i386. Xcode only compiles a framework for the target architecture, so if I built the framework for the iOS Simulator, it wouldn't work on a device, and if I built the framework for a device, it wouldn't work on the iOS Simulator.
I created my framework from scratch with help from this tutorial: http://www.raywenderlich.com/65964/create-a-framework-for-ios
The multi-architecture build script is what allowed my framework to run on both the iOS Simulator and a device.
I encountered this same problem with Xcode 7.1 when trying to build for the simulator.
Someone else said it worked for them under Xcode 8.2.1, so I tried building/running there and it worked. I didn't have to change targets or anything in my project.
So try upgrading your Xcode if you can, you will presumably get additional bug fixes as well.

Xcode 6 and Cocoapods not referencing iOS frameworks correctly

After installing Pods in an Xcode 6 project, the iOS frameworks in the Pod Project (e.g. CoreText, CFNetwork etc) all appear red and have the incorrect paths, it runs fine on simulator but when attempting to build onto device this results in a crash:
dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate
Referenced from: /var/mobile/Applications/3068D977-8690-44B7-A683-
8E213B7AA615/NoodleLive.app/NoodleLive
Expected in: /System/Library/Frameworks/CFNetwork.framework/CFNetwork
in /var/mobile/Applications/3068D977-8690-44B7-A683-8E213B7AA615/NoodleLive.app/NoodleLive
(lldb)
The incorrect paths point to
'/Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreLocation.framework'
If it was the correct path, instead of 'iPhoneOS7.1.sdk' it should be pointing to 'iPhoneOS8.0.sdk'
I'm using the latest version of cocoapods and have changed command line tools to Xcode 6.0. Any help appreciated.
The crash wasn't down to incorrect file paths on the Pods iOS frameworks, turns out that doesn't matter. This question solved my problem:
dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate when trying to run iOS app
Was down to a bug in iOS8sdk where symbols have been moved between CFNetwork and Foundation and the frameworks needed to be reordered in the pod.xconfig file. CFNetwork needs to go after Foundation.

Resources