ios9 加载动态库
阿神
阿神 2017-04-17 16:15:57
0
2
696

问题描述:
ios9 在运行时通过dlopen()方法加载动态库文件(framework),加载失败,在ios8一下版本程序运行正常。
代码如下:

// 加载应用
NSBundle *appBundle = [NSBundle bundleWithPath:appPath];
NSError *error = nil;
            
if ([appBundle loadAndReturnError:&error])
{
    NSLog(@"bundle load framework success.");
}
else
{
    NSLog(@"bundle load framework err:%@",error);
}

失败log:

bundle load framework err:Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx): no suitable image found.  Did find:
    /var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx: mmap() errno=1 validating first page of '/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx'" UserInfo={NSLocalizedRecoverySuggestion=请尝试重新安装软件包。, NSFilePath=/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx, NSLocalizedFailureReason=软件包已损坏或丢失必要的资源。, NSLocalizedDescription=未能载入软件包“xxxx”,因为它已损坏或丢失必要的资源。, NSDebugDescription=dlopen_preflight(/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx): no suitable image found.  Did find:
    /var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx: mmap() errno=1 validating first page of '/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework/xxxx', NSBundlePath=/var/mobile/Containers/Data/Application/F34F9E7A-C129-46F5-A5C6-C82E843F764C/Documents/xxxx.framework}
阿神
阿神

闭关修行中......

reply all(2)
巴扎黑

The problem is solved and you need to apply for the certificate again.

伊谢尔伦

Hello, how to solve this problem? Certificate issue, what does it mean?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template