iOS开发 The executable was signed with invalid entitlements.

The executable was signed with invalid entitlements.app

The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).ide



image-1

昨天下午想要打包,忽然发现企业证书没法签入,xocde Run 也会报错,报错信息如上图。让我很费解,明明没有作什么事情,只是换了个Bundle iD  换了个证书为了打包而已,怎么连真机运行都不能够。ui

而后度娘、google 各类查,大部分解决方案都是以下两种:google

第一种:Project - TARGETS - 项目目标名称 - Build Settings - Code Signing Entitlements 将其值置为空。
code

(我项目配置中自己就是空的,因此这个解决方案对我不适用);cdn

第二种:blog

提示The executable was signed with invalid entitlements.(The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.)错误,没有发布成功。在网上查询资料后,按照其中一个方法成功解决了此问题,具体以下:
ci

(1):在工程中添加文件new file,选择Resource 中的Property List,添加后名称为Entitlements.plist。get

(2):点击Entitlements.plist进行编辑,删除全部Root下的Key,而后添加一个Boolean类型,名称为get-task-allow的Key,状态为TRUEit

(3):在Targets中的Info中的Build选项卡中的Code Signing Entitlements的值设为Entitlements.plist,从新Build便可解决

(我按照这种方法,添加了plist 文件,可是并不起做用);

后来通过两个小时的排查终于发现了问题:

是由于同事制做的 FrameWork 包进行了签名, 因此换了证书,换了签名,Run 就会报错;



image-2 项目名敏感打码不要介意

(由于咱们作的不是动态的framework,因此必需要添加到Embedded Binaries ,而正是由于添加到这里面,framework.的签名证书,和我要项目要打包的证书签名不同,因此就会弹出image-1的错误);

最后说下解决方法:

第一种: 从新打包一个去掉签名的 .framework  ,导入工程;

第二种:对已有的 .framework 进行重签名;(打开终端,输入命令)

(1)查看framework的签名证书,确认是否被签名,或者签名不一致。

   命令:codesign -d -vv XX.framework

(2)删除原有的签名

 进入到XX.framwork文件夹内,删除_CodeSignature文件夹。

(3)查看本机可用的签名文件

  命令:/usr/bin/security find-identity -v -p codesigning

(4)使用签名文件签名

   命令:codesign -fs  “iPhone Developer: xxxx (XXXX)”  XX.framework

而后把重签名过的XX.framework 导入工程,就不会再报错了。

相关文章
相关标签/搜索