Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

frameworks

I am receiving an error that says

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

I have looked at the other questions that address this, the only one that had answers did not solve my problem, and the rest had received no answers at all.

I tried just building a framework with nothing in it at all, and adding the framework to Linked Frameworks and Libraries in the General tab of my intents app extension, and I still get this message.

When I add code to the framework, I still get the warning message.

Here is my code:

import UIKit

class Widget: NSObject {

}

I am sure to follow instructions at Some APIs Are Unavailable to App Extensions and at Using an Embedded Framework to Share Code but I still get the same warning message. I have read that Apple App Store will not pass my app for review if I have this issue.

like image 561
Daniel Brower Avatar asked Oct 19 '18 02:10

Daniel Brower


1 Answers

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

like image 85
lar3ry Avatar answered Sep 29 '22 18:09

lar3ry