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

问题描述:
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}
阿神
阿神

闭关修行中......

Antworte allen(2)
巴扎黑

问题解决了,需要重新申请证书。

伊谢尔伦

你好,这个问题,怎么解决的?证书问题,是什么意思?

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage