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.
Related
Currently, I have an issue with one of the libs that I use in the project, it simply won't let me make the build for the iOS simulator.
Getting the following error message:
Building for iOS Simulator, but the linked library '!##$%^&.a' was built for iOS.
In my class I have the following code:
#if (TARGET_IPHONE_SIMULATOR==0)
void !##$%^&_init(void);
#endif
I have tried to exclude the file when building the app for the iPhone simulator by adding it in Build Settings > Build Options > Excluded Source File Names > Any iOS Simulator SDK
I have also tried to exclude the following architectures: arm64, arm64e, and armv7.
Setting Build Active Architecture Only to YES, didn't do the trick for me, nor validating build product nor validate workspace.
Actually, none of the above-mentioned solutions worked for me, so I had to ask this question here.
As a workaround you should be able to change Build system to "Legacy Build System" under File/Project Settings.
The proper solution would be to package your library as XCFramework.
I currently have an Framework which uses Alamofire, JWT and CryptoSwift which are installed using cocapods.
My framework sucsessfully builds when I use the 'Generic iOS device'. When I go to drag it into my Application and tell it to create a copy, it appears in the 'linked frameworks and libraries' section on the general page. The problem is, when I build my application, I get an error saying that the image is not found. To fix the issue, I removed it from the 'linked frameworks and libraries' section and added it to the 'embedded binaries part'. This however, did not fix my problem.
How can I import a custom framework made out of 3rd party frameworks installed with cocopods? When I write code using my framework, it gives me auto completion so this means that Xcode recognises that my framework is there, however it does not run it on my physical iPhone 6s
I have made a Swift framework. It builds normally for running on a device but Xcode can't archive it because of bitcode.
So I tried to find bitcode setting but it's nowhere.
I tried to add -fembed-bitcode to compiler settings but it's nowhere, as well. How can I solve this problem?
I want another project that imports my framework to be able to build for both device and archive.
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.
I have searched for hours however I still have no clue what is wrong with my configuration.
My project uses a self-written libray (myLib). This library is compiled to work only for simulator and it works perfectly there.
What do have to change so it compiles for my iPhone Device as well?
This is my current warning:
ld: warning: in /.../myLib.a, file is not of required architecture
This is my configuration (of myLib.a)
I found a lot of articles explaining the reason for this error however I could not find a solution:
The simulator runs on an x86
architecture, while the device uses an
ARM architecture.
What do I have to change to get my library working on my iPhone?
Thanks
Edit:
What I did so far:
Cleaned both projects
Set library to 'Device' (3.1)
Built the library
Dragged the .a file of my library into my application
Result:
This works in simulator but setting the active sdk to device still raises a file is not of required architecture error.
I also tried mahboudz ( thanks for your support) link.
It explains howto built the project using a shell script.
However XCode keeps complaining that the library file is of the wrong architecture and the build fails.
This has to be a really stupid beginners mistake.
You need to add both .a files,the one built for the device (build/$config-iphoneos)and the one built for the sim (build/$config-iphonesimulator) to the new project. Make sure you name them differently before dropping them in. This is how admob and similar offering ship their static libs.
You need to compile your library for Intel so the Simulator can use it (which I gather you have done already), and then compile it for ARM, so it can run on the iPhone. Then you have to merge the two libraries. There are different ways to accomplish that, or make it more automatic.
Here are some links to help you:
http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html
http://www.clintharris.net/2009/iphone-app-shared-libraries/
I've met the same problem too. But seems you don't need to drag two .a files into the app project to solve this problem. This is what I did:
Drag the static library project into app project's framework group
"Get Info" for the target in app project
Set the direct dependency of static library
Make clean all unnecessary builds(for example the simulator build) in the static library project
Build in the app project