与dylib链接的警告消息,该dylib在应用程序扩展中不安全使用 [英] warning message linking against a dylib which is not safe for use in application extensions

查看:137
本文介绍了与dylib链接的警告消息,该dylib在应用程序扩展中不安全使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条错误消息

链接到在应用程序扩展中不安全使用的dylib

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.

我尝试仅构建一个完全不包含任何内容的框架,并将该框架添加到我的Intent应用程序扩展的常规"选项卡中的链接的框架和库"中,但仍然收到此消息.

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.

这是我的代码:

import UIKit

class Widget: NSObject {

}

我一定会按照使用嵌入式框架共享代码,但我仍然收到相同的警告消息.我已经阅读到,如果遇到此问题,Apple App Store将不会通过我的应用程序进行审核.

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.

推荐答案

如果要链接到您控制的框架,请在项目中选择框架目标.在常规标签中,查看部署信息,您会看到一行:

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.

此复选框可确保仅使用对App Extension中有效的API的调用.

This checkbox ensures that only calls to APIs that are valid within App Extensions are used.

这篇关于与dylib链接的警告消息,该dylib在应用程序扩展中不安全使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆