johnno1962 / injectionforxcode

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

Inject source error #240

Closed MostarChow closed 6 years ago

MostarChow commented 6 years ago

iewController/Commodity/ProductDetail/NTProductDetailViewController.m -o /Users/mostar/Library/Developer/Xcode/DerivedData/BeAtOne-fbpjjnenaspcruhkckmxgldxursq/Logs/Build/../iOSInjectionProject/x86_64/injecting_class.o
fatal error: file ‘/Users/mostar/Documents/Workspace/Github/BeAtOne-iOS/BeAtOne/BeAtOne/Resources/Security/codeObfuscation.h’ has been modified since the precompiled header ‘/Users/mostar/Library/Developer/Xcode/DerivedData/BeAtOne-fbpjjnenaspcruhkckmxgldxursq/Build/Intermediates.noindex/PrecompiledHeaders/Mostar-PrefixHeader-dxjeuxoqmuxeecergjzjnljwdngw/Mostar-PrefixHeader.pch.pch’ was built
note: please rebuild precompiled header ‘/Users/mostar/Library/Developer/Xcode/DerivedData/BeAtOne-fbpjjnenaspcruhkckmxgldxursq/Build/Intermediates.noindex/PrecompiledHeaders/Mostar-PrefixHeader-dxjeuxoqmuxeecergjzjnljwdngw/Mostar-PrefixHeader.pch.pch’
1 error generated.
 0.08 real 0.03 user 0.05 sys

 Learnt compile failed 

 at /Applications/Injection.app/Contents/Resources/common.pm line 61.
 main::error(‘Learnt compile failed’) called at /Applications/Injection.app/Contents/Resources/injectSource.pl line 389
 Bundle build failed

polac24 commented 6 years ago

Did you try to completely clean your project using CMD+SHIFT+K?

MostarChow commented 6 years ago

@polac24 YES, I have try.

polac24 commented 6 years ago

Another issue may be related to a path that includes sign "-". Although I made a test and successfully injected some swift class to a project that includes minus sign in a path, can you just try if this error will still pop up if you change a project directory from BeAtOne-iOS to BeAtOneiOS?

johnno1962 commented 6 years ago

Have you tried deleting /Users/mostar/Library/Developer/Xcode/DerivedData/BeAtOne-fbpjjnenaspcruhkckmxgldxursq/Build/Intermediates.noindex/PrecompiledHeaders/Mostar-PrefixHeader-dxjeuxoqmuxeecergjzjnljwdngw/Mostar-PrefixHeader.pch.pch?

MostarChow commented 6 years ago

@johnno1962 I've tried. Maybe my project was wrong.

MostarChow commented 6 years ago

@johnno1962 @polac24 I found the reason. Because I use confuse.sh to errors.

johnno1962 commented 6 years ago

Happy to hear it. You had us scratching our heads. Have you tried the new version of injection? https://github.com/johnno1962/InjectionIII