库未加载:@rpath和iOS8

时间:2021-09-08 21:52:01

I'm creating an iOS framework with Xcode6 and iOS8. When I link this with an iOS app and try running it on the device I get this error

我正在用Xcode6和iOS8创建一个iOS框架。当我把它和一个iOS应用连接起来并在设备上运行时,我得到了这个错误

dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName
  Referenced from: /private/var/mobile/Containers/Bundle/Application/0F2C2461-A68B-4ABA-A604-B88E6E9D1BB1/AppName.app/AppName
  Reason: image not found

The 'Runpath Search Paths' build setting for the framework is set by default to

框架的“Runpath搜索路径”构建设置默认设置为

'@executable_path/Frameworks', '@loader_path/Frameworks'

I could not find any documentation related to this. This was something new introduced with Xcode6 and I would expect it to just work by simply including the framework into any app that needs it.

我找不到任何与此相关的文件。这是Xcode6引入的新内容,我希望它只是简单地将框架包含到任何需要它的应用程序中。

9 个解决方案

#1


51  

To make this work

做这项工作

  1. In the framework project settings change the install directory from '/Library/Frameworks' to '@executable_path/../Frameworks'

    在框架项目设置中,将安装目录从“/Library/ framework”更改为“@executable_path/. / framework”

  2. In the project that includes this framework, add a copy files phase and copy this framework to the 'Frameworks' folder. Once you do this ensure that this framework is listed under the 'Embedded Binaries' section.

    在包含此框架的项目中,添加一个复制文件阶段,并将该框架复制到“框架”文件夹。一旦您这样做了,确保这个框架在“嵌入式二进制文件”一节中列出。

#2


17  

Issue resolved using this answer. According to @vladof81:

使用此答案解决问题。根据@vladof81:

In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.

在目标的General选项卡中,有一个嵌入式二进制字段。当您在那里添加框架时,崩溃就解决了。

Reference is here on Apple Developer Forums.

这里是苹果开发者论坛的参考。

#3


5  

I was getting this error on a library installed through CocoaPods. Cleaning the build folder (cmd + option + shift + k) and then doing a clean (cmd + shift + k) was what ended up resolving this issue for me.

我在通过CocoaPods安装的图书馆中发现了这个错误。清理构建文件夹(cmd +选项+ shift + k)然后进行清理(cmd + shift + k)最终解决了这个问题。

#4


3  

For me it was because of the SSL issue, I had set my developer, distribution certificates on my Mac(Keychain) to 'Always Trust' for one of my other project. I had to change them back to 'Use System Defaults'. it was working for me then!!

对我来说,因为SSL问题,我将我的开发人员、Mac上的分发证书(Keychain)设置为“永远信任”我的另一个项目。我不得不把它们改成“使用系统默认值”。那对我很有效!!

#5


2  

Check if you can find framework in context under :

查看你是否能在以下背景下找到框架:

Build Phases > Embed Frameworks >

构建阶段>嵌入框架>

If not just add that framework in "Embed Frameworks" after adding that framework in your project directory's "Frameworks" section.
库未加载:@rpath和iOS8

如果不只是在项目目录的“框架”部分中添加框架之后,在“嵌入框架”中添加框架。

#6


1  

In addition to the above solutions, recheck the paths of frameworks included in your application under

除了上述解决方案之外,请重新检查应用程序中包含的框架路径

Build Settings --> Search Paths --> Framework Search Paths

构建设置——>搜索路径——>框架搜索路径

#7


0  

I also had same kind of problem where I was not able to launch the app & app was crashing with above message :

我也遇到了同样的问题,我无法启动app & app,上面的信息让我崩溃了:

dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx

@rpath/FrameworkName.framework/FrameworkName引用自:/private/var/mobile/ container /Bundle/Application/xxxxxxxxxxxxx

Reason: image not found

原因:没有找到图片

Here is my approach that helped me to resolve this error:

以下是我解决这个错误的方法:

1.Please delete your app from device, Clean the build and and rebuild and run on the device.

1。请从设备中删除您的应用程序,清理构建并重新构建并在设备上运行。

2.If above steps does not help you, then please check for below settings :
From "TARGET">"Build Settings">"Runpath Search Paths" & then check for values "$(inherited)" & "@executable_path/Frameworks", Feel free to add incase they don't exist.

2。如果以上步骤对您没有帮助,那么请检查以下设置:从“TARGET”>“Build settings”“>”Runpath Search Paths“然后检查值“$(继承)”&“@executable_path/ framework”,如果它们不存在,请随意添加。

Build your app and run it on device

构建应用程序并在设备上运行

#8


0  

When non of those solution works:

当这些解决方案都不起作用时:

  1. (Optional) Get a clear knowledge from here on different search path type
  2. (可选)从这里了解不同的搜索路径类型
  3. Make sure that your .framework file paths are added in Build Settings -> Framework Search Paths. You can keep all framework files somewhere in App/libs/ and add this folder and enable recursively.
  4. 确保你的。Framework文件路径被添加到Build Settings ->框架搜索路径中。您可以将所有框架文件保存在App/libs/中,并添加此文件夹并启用递归。
  5. Make sure that your .a files paths are added in Build Settings -> Library Search Paths.
  6. 确保您的a文件路径被添加到构建设置中——>库搜索路径。

库未加载:@rpath和iOS8

#9


-2  

Just type cmd + shift + k it works:

只要输入cmd + shift + k就可以了:

i got error in :PersianDatePicker library

我在:PersianDatePicker库中出错

#1


51  

To make this work

做这项工作

  1. In the framework project settings change the install directory from '/Library/Frameworks' to '@executable_path/../Frameworks'

    在框架项目设置中,将安装目录从“/Library/ framework”更改为“@executable_path/. / framework”

  2. In the project that includes this framework, add a copy files phase and copy this framework to the 'Frameworks' folder. Once you do this ensure that this framework is listed under the 'Embedded Binaries' section.

    在包含此框架的项目中,添加一个复制文件阶段,并将该框架复制到“框架”文件夹。一旦您这样做了,确保这个框架在“嵌入式二进制文件”一节中列出。

#2


17  

Issue resolved using this answer. According to @vladof81:

使用此答案解决问题。根据@vladof81:

In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.

在目标的General选项卡中,有一个嵌入式二进制字段。当您在那里添加框架时,崩溃就解决了。

Reference is here on Apple Developer Forums.

这里是苹果开发者论坛的参考。

#3


5  

I was getting this error on a library installed through CocoaPods. Cleaning the build folder (cmd + option + shift + k) and then doing a clean (cmd + shift + k) was what ended up resolving this issue for me.

我在通过CocoaPods安装的图书馆中发现了这个错误。清理构建文件夹(cmd +选项+ shift + k)然后进行清理(cmd + shift + k)最终解决了这个问题。

#4


3  

For me it was because of the SSL issue, I had set my developer, distribution certificates on my Mac(Keychain) to 'Always Trust' for one of my other project. I had to change them back to 'Use System Defaults'. it was working for me then!!

对我来说,因为SSL问题,我将我的开发人员、Mac上的分发证书(Keychain)设置为“永远信任”我的另一个项目。我不得不把它们改成“使用系统默认值”。那对我很有效!!

#5


2  

Check if you can find framework in context under :

查看你是否能在以下背景下找到框架:

Build Phases > Embed Frameworks >

构建阶段>嵌入框架>

If not just add that framework in "Embed Frameworks" after adding that framework in your project directory's "Frameworks" section.
库未加载:@rpath和iOS8

如果不只是在项目目录的“框架”部分中添加框架之后,在“嵌入框架”中添加框架。

#6


1  

In addition to the above solutions, recheck the paths of frameworks included in your application under

除了上述解决方案之外,请重新检查应用程序中包含的框架路径

Build Settings --> Search Paths --> Framework Search Paths

构建设置——>搜索路径——>框架搜索路径

#7


0  

I also had same kind of problem where I was not able to launch the app & app was crashing with above message :

我也遇到了同样的问题,我无法启动app & app,上面的信息让我崩溃了:

dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx

@rpath/FrameworkName.framework/FrameworkName引用自:/private/var/mobile/ container /Bundle/Application/xxxxxxxxxxxxx

Reason: image not found

原因:没有找到图片

Here is my approach that helped me to resolve this error:

以下是我解决这个错误的方法:

1.Please delete your app from device, Clean the build and and rebuild and run on the device.

1。请从设备中删除您的应用程序,清理构建并重新构建并在设备上运行。

2.If above steps does not help you, then please check for below settings :
From "TARGET">"Build Settings">"Runpath Search Paths" & then check for values "$(inherited)" & "@executable_path/Frameworks", Feel free to add incase they don't exist.

2。如果以上步骤对您没有帮助,那么请检查以下设置:从“TARGET”>“Build settings”“>”Runpath Search Paths“然后检查值“$(继承)”&“@executable_path/ framework”,如果它们不存在,请随意添加。

Build your app and run it on device

构建应用程序并在设备上运行

#8


0  

When non of those solution works:

当这些解决方案都不起作用时:

  1. (Optional) Get a clear knowledge from here on different search path type
  2. (可选)从这里了解不同的搜索路径类型
  3. Make sure that your .framework file paths are added in Build Settings -> Framework Search Paths. You can keep all framework files somewhere in App/libs/ and add this folder and enable recursively.
  4. 确保你的。Framework文件路径被添加到Build Settings ->框架搜索路径中。您可以将所有框架文件保存在App/libs/中,并添加此文件夹并启用递归。
  5. Make sure that your .a files paths are added in Build Settings -> Library Search Paths.
  6. 确保您的a文件路径被添加到构建设置中——>库搜索路径。

库未加载:@rpath和iOS8

#9


-2  

Just type cmd + shift + k it works:

只要输入cmd + shift + k就可以了:

i got error in :PersianDatePicker library

我在:PersianDatePicker库中出错