Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,dlopen执行打开就失败闪退,不知道什么原因,能帮看下吗 #18

Open
NobodyCanStop opened this issue Aug 16, 2018 · 1 comment

Comments

@NobodyCanStop
Copy link

NobodyCanStop commented Aug 16, 2018

main函数执行dlopen的代码:
NSLog(@"\n===Start===\n"); NSString * dylibName = @"myapp"; NSString * path = [[NSBundle mainBundle] pathForResource:dylibName ofType:@"dylib"]; NSLog(@"thePath=(%@)",path); void * libHandle = dlopen([path cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);

执行dlopen时闪退,错误日志如下:

objc[2351]: Class AppDelegate is implemented in both /var/containers/Bundle/Application/FD8D1781-C830-44E8-9E49-E656B08431C3/TestAppLoadDylib.app/TestAppLoadDylib and /var/containers/Bundle/Application/FD8D1781-C830-44E8-9E49-E656B08431C3/TestAppLoadDylib.app/myapp.dylib. One of the two will be used. Which one is undefined.
2018-08-16 18:23:02.683 TestAppLoadDylib[2351:109988] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'
*** First throw call stack:
(0x1812cadb0 0x18092ff80 0x1812cacf8 0x181c29338 0x181c292bc 0x102f21500 0x1809320cc 0x180932df0 0x1200d9d3c 0x1200e80c4 0x1200e7280 0x1200e7334 0x1200dd160 0x1200e2160 0x180d456a0 0x1000926cc 0x180d468b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

@MrChens
Copy link

MrChens commented Aug 17, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants