DyCI / dyci-main

Dynamic Code Injection Tool for Objective-C
MIT License
1.12k stars 121 forks source link

Symbol not found expected in flat namespace #110

Open iosanimations opened 8 years ago

iosanimations commented 8 years ago

I try to use DyCI in my project, but when i press ctrl + =, error happened. After searching on google, i still can not find what is the problem. Here is the error message:

2016-08-17 11:31:05.744 beiliao[7207:815699] Couldn't load file Error : dlopen(/Users/huangzeyu/.dyci/dyci4239950.dylib, 10): Symbol not found: _OBJC_CLASS_$_BLAccountRestartRequest Referenced from: /Users/huangzeyu/.dyci/dyci4239950.dylib Expected in: flat namespace in /Users/huangzeyu/.dyci/dyci4239950.dylib

does anyone get any idea?

lysongzi commented 7 years ago

xcode 8? i meet this question too... does anyone get any idea?

PaulTaykalo commented 7 years ago

Just to clarify @lysongzi Are you using unsigned Xcode 8? How did you manage to install Plugin in the xcode8?

PaulTaykalo commented 7 years ago

@lysongzi please update the latest to xcode plugin and say if it works for you. DyCI/dyci-xcode-plugin@094dd03

lysongzi commented 7 years ago

cooooool! it works! but in my project, i also meet this: Couldn't load file Error : dlopen(/Users/bingolin/.dyci/dyci1809190.dylib, 10): Symbol not found: _OBJCCLASS$_QQMoreOptionTableViewCell Referenced from: /Users/bingolin/.dyci/dyci1809190.dylib Expected in: flat namespace in /Users/bingolin/.dyci/dyci1809190.dylib

PaulTaykalo commented 7 years ago

@lysongzi 1) What class are you trying to inject? 2) Is this class is in your project, or is it in pod or something?

lysongzi commented 7 years ago

main project add some subproject as target dependency. the injected class(UIViewController) is in main project, and it import some class in subproject.

PaulTaykalo commented 7 years ago

Cool, iI'll be really helpful if you give me small demo project, where I can reproduce this issue. Will try to take a look this week. Seems this one is also related https://github.com/DyCI/dyci-main/issues/68

lysongzi commented 7 years ago

ok i try to find out a demo later.

lysongzi commented 7 years ago

@PaulTaykalo i find a way to reproduce this issue. 1)add a new oc class. (not injected) 2)then viewcontroller(wait to injeted) import this class and generate some object. 3)inject the viewcontroller.

can't it compilation the relative new class ? i have to manual inject new class ,then available to use new class?

PaulTaykalo commented 7 years ago

@lysongzi exactly

lysongzi commented 7 years ago

i find another way to reproduce this issue. 1) sub project has a class named AClassInSub. but not to import it firstly.
2) run the app.
3) in main project, view controller import AClassInSub and generate some object. inject this view controller.