still dyld: Library not loaded - iphone

I am integrating Facebook in my application. As required frameworks I added to the project.
But the app crashes without loading even first screen.
dyld: Library not loaded: /System/Library/Frameworks/AdSupport.framework/AdSupport
Referenced from: /var/mobile/Applications/8E09C9AA-CA81-4C26-AEED-B2C632B60A54/Gridlocked.app/Gridlocked
Reason: image not found
I use Xcode 4.5 and my iPad runs iOS 5.1 The app runs fine on the simulator (both 6.0 & 5.1), but when I connect the iPad and change the deployment target to 5.1 (as without this the device is not shown to run), the app crashes.

Found out the solution to the problem.
The problem was setting the added frameworks as required instead of optional
GO TO Project-> Targets-> Build Phases-> Link Binary with Libraries
There, set the status of added frameworks to Optional
This solved my problem.

It may happen because of framework compilation. I worked out it
App target -> Build Phases -> Embed Frameworks.
So mark copy only when installing on. Clean the project and run it!

You need to add this Framework to Xcode.
Right-click on "Frameworks" > Choose Add > Existing Frameworks
Locate "AVFoundation" then choose Add.
If you want to add it manually, choose the other button and navigate to:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks/AVFoundation.framework/
Replace the iPhone SDK version with whatever you are building against.
Perhaps also see this answer: Missing AVFoundation.framework
Also, sometimes you just need to close Xcode, then clean and rebuild.
also see dyld: Library not loaded: AVFoundation.framework Reason: image not found

I had the same problem. i keep all .dylib in system root directory usr/lib it working fine. At the run time .o file not get .dylib file path then it gives an error.

Related

Archive failed with custom framework

I have the custom framework name LogginFramework and I use it in my project. I can debug and I can call the class of LogginFramework in my simulator. Now I tried to archive my project to send to the tester, build failed and showing" Use of unresolved identifier 'CryptoHelper'" How can I solve this issue? I already added framework in Embedded binaries and "Linked framework in Libraries" My Swift 3 app rebuilds and runs successfully on all simulators except for Generic iOS Device. If I try to archive it or do a rebuild on Generic iOS Device, I get a No such module error relating to my custom frameworks.
I tried build,clean,delete drived-data but still error
Hope this will help you
Select your Project in Targets.
Then search for Skip install.
Change it into NO.
Then archive your custom framework. (make sure to use Generic
iOS Device ) as a target device.
Export it to where you want.
Then use it with your project.

Error when migrating from Swift 1.2 to Swift 2

I use Realm in my project and so far it has been great ! I have migrated from swift 1.2 to Swift 2 and now I have an error when compiling my code on the device (not on simulator).
Here is the error :
dyld: Library not loaded: #rpath/libswiftSecurity.dylib Referenced
from:
/private/var/mobile/Containers/Bundle/Application/64E2D461-F95C-4E86-B3D3-5FAAA00AF77C/myPhotoCalendar.app/Frameworks/RealmSwift.framework/RealmSwift
Reason: image not found
I really don't understand what it means. I tried some tricks but none of them worked so far. Any one could help me ?
You see this error, because you're using dynamic frameworks, but they are not copied into your app bundle. On the simulator, the dynamic linker can still find the built framework in the build products directory. But this is not present in the sandbox of the device, where your app is executed.
It seems like that's the case because the build phase "Embed Pods Frameworks" is missing from your project. Please make sure that CocoaPods is up to date. (gem update cocoapods) You might then want to use your integration by pod deintegrate and re-install from scratch again. (Alternatively, you could remove the aggregate target Pods_*.framework from the linked libraries.) That should make sure, that all build phases are re-created by CocoaPods.
For references, you should have the build phases like seen below in your project's target:
The mentioned aggregate target framework is seen in the "Link Binary With Libraries" pane as Pods.framework here. The name depends on whether or not you integrate multiple targets of your project and how they are named. So it could be also named Pods_YourApp.framework.

Cocos2d-x project's 2nd rebuild onwards gives an error 'Xcode cannor run using selected device'

Fresh cocos2d-x project build using Xcode runs normally on iOS simulator/device, but after making changes to cpp source files, rebuild fails with error-
Xcode cannor run using selected device. Choose a destination with a supported architecture in order to run on this device.
The only way to make it work is delete build binaries (i.e. delete XCode>Derived Data folder), and take fresh build after restarting Xcode.
Can someone please help me resolve this issue?
Additional Details:
This error is related to mismatching device architecture and armv6 armv7 flags. But first build works fine, and stops working after second build onwards, that means this is not a possible issue.
If the project is not using cocos2d-x (i.e. plain Objective-C project), then there is no such error after second build.
Compiler selected: Apple LLVM Compiler 4.2
Thanks in advance!
Following my comment you should make sure you use the latest templates for creating cocos2d projects. Some templates will only work for a specific Xcode version so make sure you use the right templates for your xcode version (There are some for xcode 3.x and others for xcode 4.x)
Change Valid architecture to armv7 and armv7s. Remove armv6. See image for more information.

XCode 4.5 (4G182) + iPhone 5 iOS6 - Choose a destination with a supported architecture in order to run on this device

So I have a brand new app I created last night for iOS6, using XCode 4.5. I can properly develop on my iPhone 4 with iOS6.
Today I got my new iPhone 5 with iOS6 and, after updating the certificates with the new device UUID, I tried to run my app on it and got this error:
XCode cannot run using the selected device. Choose a destination with
a supported architecture in order to run on this device.
I've enabled the device for development. Both armv7 and armv7s are on the settings.
I have included the sources from the Facebook 3.0 SDK and the linker flag '-lsqlite3.0'. I'm guessing the issue has to be related, but cannot figure what is wrong.
Any ideas how to solve it?
PS: The issue happens too when running the app on the simulator. No idea what changed on my project or XCode between last night and today, other than I have a new device and new certificates.
The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software.
Also you need to select the compiler LLVM in
Project --> Build Settings --> Build Options
I have found the same issue while running an OLD project on XCode 5.0 and My solution is:
You need to do following steps for getting out with this:
1. Set Valid Architectures : armv7,armv7s
2. Set compiler as LLVM in Project ---> Build Settings ---> Build Options.
3. Set Base and Deployment sdk properly.
This is my solution. Happy To Help.
You need to add armv7s to your valid architectures under your Target's Build Settings.
You included src/Framework/Resources/Info.plist when added Facebook SDK files to your project. Just remove it from your project and everything will work again. Guaranteed! :)
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it is working fine..
Make sure the bundle name (in plist file) is same as the project name. I changed it and it worked.
One of my 3rd party libraries couldn't run on armv7s so I removed that option. I also removed armv6 and kept armv7 as the only option. It built and ran on the phone with only armv7.
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..
I faced this problem because Build settings-> Complier for C/C++/Objective c was set wrong.
So I changed it to default compiler available, it worked!
Just need to select the compiler LLVM in
Targets --> Build Settings --> Build Options
I ran into the same problem. When I check the compiler it is showing incompatible compiler. you need to make it valid one. To set valid compiler follow the steps
select your
project----> build settings-->
on the search bar type compiler and search
now you can find build options under build options you will find compiler for c/c++/objective c set it to valid one.
So basically I created a new project, copied all the sources and everything seems to work fine. At least the app runs.
I am not sure which setting was causing the problem.
I had an issue with an out of data library that was built for iOS 4.x and I was building a new app for iOS 6 with iPhone 5 support. I received this error and the only way I resolved it was to make armv7 the only architecture and valid architecture listed in my project and target build settings.
remove info.plist refrence. And then re-drag info.plist to proj but don't copy to "target"
You just goto Build setting Then valid architecture Replace armv7 armv7s instead of armv7 .Then it will work fine .
Ok, not sure if this is the Problem in Your Project. But what fixed it for me, was to change the Name of the Info.plist File.
I changed the name from Info.plist to my-project-info.plist
also change it under target-build-settings/Packaging/Info.plist
Than delete the App from Devices/Simulators and re-run the App through Xcode
In my Case, everything worked fine since than. In my Case there was nothing wrong with the specifications made in the plist file or with the valid architectures.
some times this happens when your project was build in xcode 4.5 and you are trying to run in xcode 5.0.
so in my case I found the solution.
Change your compiler for C/C++/ObjectiveC Go to Build
Settings->Build OPtions->compiler for C/C++/ObjectiveC; select
Default(Apple LLVM5.0)

iphone warning libsqlite3.dylib is not of required architecture?

I'm writing an iPhone app which seems to run fine on the simulator, however when I try and run it on the device I get a libsqlite3.dylib, file is not of the required architecture error. I'm using os 3.0 on a 3GS. Any ideas on what could be causing this?
Thanks!
When you added the SQLite library to your project, it sounds like you chose the one from the iPhoneSimulator sdk. You need to choose the one in the iPhoneOS sdk for whichever version you're building for.
If you still get the error make sure you haven't accidentally copied the simulator version of the lib into your own project directory. You need to delete it if you have. This would have occurred because you accidentally selected 'Copy items into destination groups folder' when you added the lib to your project. Also make sure reference type is 'Relative to Current SDK'.
I had a similar issue which caused by the search paths for the linked library pointing to incompatible files.
I wrote a blog post on how to fix it here:
Fixing the "missing required architecture arm in file" error when developing for iPad