iOS添加framework, 报错“dyld: Library not loaded” Reason: image not found

背景

iOS项目的测试demo需要测试自己的的framework,叫IJKMediaFramework.framework。按如下方式导入后,运行起来报错。 

1. 将该framework放到工程下的某个文件下。 

2. 按照TARGETS->选择target->Build Phases->Link Binary With Libraries,添加该framework。

错误信息如下:

dyld: Library not loaded: @rpath/IJKMediaFramework.framework/IJKMediaFramework

  Referenced from: /Users/tzx/Library/Developer/CoreSimulator/Devices/87A396C9-2719-4967-AA4C-2EDA39C26583/data/Containers/Bundle/Application/20E732BC-5EA9-47E8-8945-9E526C61319B/IJKMediaDemo.app/IJKMediaDemo

  Reason: image not found

 解决

在TARGETS->选择target->General-> Framework,Libraries,and Embedded Content下下,设置该Framework  Embed & sign。如下图:

 

iOS添加framework, 报错“dyld: Library not loaded” Reason: image not found_第1张图片
001

你可能感兴趣的:(iOS添加framework, 报错“dyld: Library not loaded” Reason: image not found)