johnno1962 / InjectionApp

Issue Tracking Repo for Injection as an App
MIT License
111 stars 7 forks source link

Didn't work on subProject #7

Open starFelix opened 7 years ago

starFelix commented 7 years ago

Our project is consisted with a main project and some sub project. Some sub project build depend on some code in main project. If I start injection, I would get some error said that file not found. Because these file didn't belong to the sub project.

johnno1962 commented 7 years ago

Can you provide more detail? Objective-C/Swift?

starFelix commented 7 years ago

I had pushed a repo which was a demo for this error. https://github.com/starFelix/TestInjection You can try to inject the file ErrorSubProject.

johnno1962 commented 7 years ago

Thanks for the example project it helped a lot working out what the problem was. Injection compiles using the overall project root even for files in the subproject so relative paths like -I.. won’t work. Try $SRCROOT/.. in your build settings.

starFelix commented 7 years ago

Thank you very much! I have solved this issue. By the way, can injection use in device? If not, what's the problem?

starFelix commented 7 years ago

@johnno1962 If I check "recursive", the error will appear. Are there any way to make it support any path setting?

johnno1962 commented 7 years ago

Injection to device is prevented by iOS 10 sandboxing. Not sure what you mean about “recursive” if you told me the error perhaps I could help you.

starFelix commented 7 years ago

2017-01-13 9 41 51 If you set the project like above, inject will fail.

starFelix commented 7 years ago

Sub project's "header search path".