Apple MACh-O Linker (Id) Warning:Building for MACosx, But Linking Against Dylib Built for iOS

Building for MacOSX, but linking against dylib built for iOS Simulator file

The problem was that Xcode 5 replaces gcc with clang and adds in a "-triple" option that specifies OSX as the target. If you pass "-miphoneos-version-min=7.0" on both gcc command lines it works. You can see the clang command line if you pass "--verbose" to gcc. It's also necessary to add to the PATH for Xcode 5 so that cmake can find the necessary tools: export PATH=/Applications/Xcode5-DP6.app/Contents/Developer/Toolchains/XcodeDefault.xct‌​oolchain/usr/bin:/Applications/Xcode5-DP6.app/Contents/Developer/usr/bin:$PATH None of this is official.. but works for me so far.

warning message linking against a dylib which is not safe for use in application extensions

If you are linking against a framework you control, select the framework target in your project. In the General tab, look at Deployment Info and you will see a line:

App Extensions: [ ] Allow app extension API only

Select the checkbox, and you should be able to link against this framework.

This checkbox ensures that only calls to APIs that are valid within App Extensions are used.
Framework Target General Tab

Xcode building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'

Basically, you have to exclude arm64 for the simulator architecture, both from your project and the Pod project.

  • To do that, navigate to Build Settings of your project and add Any iOS Simulator SDK with value arm64 inside Excluded Architecture.

    Sample Image

OR

  • If you are using custom XCConfig files, you can simply add this line for excluding simulator architecture.

    EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64

    Then

    You have to do the same for the Pod project until all the Cocoa pod vendors are done adding following in their Podspec.

    s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
    s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

    You can manually add the Excluded Architecture in your Pod project's Build Settings, but it will be overwritten when you
    use pod install.

    In place of this, you can add this snippet in your Podfile. It will write the necessary Build Settings every time you run pod install.

    post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    end

Duplicate dylib warning in xcode

Well you need to find that duplicate file first,You are having that file more than once thats why its happening , and then delete that file and moreover also delete the app from the simulator.Remove the build,clean the targets and then run your app.Hope it would help you dear.....
Have a great time and coding bro....



Related Topics



Leave a reply



Submit