johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 566 forks source link

run failure #198

Closed zhaokera closed 7 years ago

zhaokera commented 7 years ago

ctrl+=

2017-01-25 10:30:36.193788 downPhoto[1661:39508] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/zhaok/Library/Developer/CoreSimulator/Devices/CF7EAFD0-2172-455F-A608-CA4820098DD9/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2017-01-25 10:30:36.194287 downPhoto[1661:39508] [MC] Reading from private effective user settings.

johnno1962 commented 7 years ago

That’s a new one. Not sure it’s a problem with injection tho. Does it always do it?

zhaokera commented 7 years ago

yes,xcode8.2.1

johnno1962 commented 7 years ago

Even with a simple example project? When did you download?

zhaokera commented 7 years ago

Today,runs successfully but product->No menu

johnno1962 commented 7 years ago

Are you using the plugin or the easier to use App? http://johnholdsworth.com/injection.html. There is no Product menu item with the App

zhaokera commented 7 years ago

ctrl+= Compiling /Users/zhaok/downPhoto/downPhoto/downPhoto/main.m 0.09 real 0.02 user 0.06 sys 2017-01-25 17:16:40.643 downPhoto[7895:417432] Injection Error: Could not locate referencesSection, are there any classes being injected? 2017-01-25 17:16:40.644 downPhoto[7895:417645] Bundle has failed to load. If this is due to symbols not found, this may be due to symbols being hidden from dynamic libraries. 10 injections performed so far.

johnno1962 commented 7 years ago

You need to inject a Class file.

zhaokera commented 7 years ago

Injection app -> inject Source...->And then? I am a rookie ,Can say in detail

ccwinner commented 7 years ago

@zhaokera The menu item doesn't show either in Product menu, how did you fix it?

johnno1962 commented 7 years ago

The menu item in the product menu is only for the plugin version of injection. If you’re using the app http://johnholdsworth.com/injection.html it should appear on the task bar.

ccwinner commented 7 years ago

@johnno1962 I set up plugin first in reference of tutorial. Then I closed the injection project (had checked that the injection plugin is right in ~/Library/../plugins), opened my own project in Xcode, and chose to confirm when Xcode reminded me of whether the plugin should be loaded. After that, I failed to find the menu item in product menu.

ansinyutin commented 7 years ago

reinstalling the injection app helped me with this error: Injection Error: Could not locate referencesSection, are there any classes being injected

johnno1962 commented 7 years ago

Are you injecting a file that contains (non-generic) classes?

ansinyutin commented 7 years ago

Yes, i was injecting non-generic class.

johnno1962 commented 7 years ago

Did injection recompile the right file?

ansinyutin commented 7 years ago

After reinstalling the application, the injection recompiled the correct file. But after an hour of work, it's not. Now regardless of which file I try to recompile, it writes File not recently modified. Did you save it? Compiling .../WrongFileName.m

johnno1962 commented 7 years ago

Are you using a “Companion Editor View”? Have you tried selecting the file in the file browser at the left hand side?

ansinyutin commented 7 years ago

I had multiple tabs in Xcode. After I closed all the tabs everything worked. Thank you!