johnno1962 / injectionforxcode

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

Build Failed with status: 65 #57

Closed haashem closed 9 years ago

haashem commented 9 years ago

Hi thanks for developing this life savior plugin. thats the thing I was always looking for.

I have project with some dependency managed with cocoapods.

the project itself run well. but when I try to inject code from my ViewController, injection failed with error:

* Build Failed with status: 65. You may need to open and edit the bundle project to resolve issues with either header include paths or Frameworks the bundle links against. *

generated error: /Users/hashem/Desktop/Xcode Projects/MyProject/MyProject/RestMenuViewController.m:10:9: fatal error: ‘BLKDelegateSplitter.h’ file not found
#import “BLKDelegateSplitter.h”
 ^
1 error generated.

** BUILD FAILED **

BLKDelegateSplitter is a file that cocoaPods manage for me. but my project compiles with no error! what should I do?

johnno1962 commented 9 years ago

Hi, not sure without seeing a little more of the log but I’d say the problem is that you have a space in the path to your Xcode project. It must have been unable to use a “learnt compile” which isn’t susceptible to problems with cocoa pods headers.

johnno1962 commented 9 years ago

This should be resolved now https://github.com/johnno1962/injectionforxcode/commit/7cff544a3c3285740a1db4f1577b0fa309a96a19. Projects under directories with spaces where not using “learnt compile”. Thanks for the bug report!

haashem commented 9 years ago

fixed! thanks. is there any way to change keyboard shortcut? It force me to use my 2 hands, ctrl+= are two other side of keyboard.

johnno1962 commented 9 years ago

Sorry about the delay. The keyboard shortcut is easy to change in INPluginMenuController.m:

        struct { char *item,  *key; SEL action; } items[] = {
            {"Injection Plugin", "", NULL},
            {"Inject Source", "=", @selector(injectSource:)}
        };

        for ( int i=0 ; i<sizeof items/sizeof items[0] ; i++ ) {
            NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithUTF8String:items[i].item]
                                                              action:items[i].action
                                                       keyEquivalent:[NSString stringWithUTF8String:items[i].key]];
            [menuItem setKeyEquivalentModifierMask:NSControlKeyMask];
            if ( i==0 )
                [subMenuItem = menuItem setSubmenu:self.subMenu];
            else
                [menuItem setTarget:self];
            [productMenu addItem:menuItem];
        }
johnno1962 commented 9 years ago

Better still, I’ve made it a preference in the tunable app parameters page https://github.com/johnno1962/injectionforxcode/commit/44a20724e1099313b238adc2f008eb2aad54a0f8

lianghuiyuan commented 8 years ago

I have come across this issues too today. The reason I think is The path of your project contains special character(eg:中文路径). You should move your project to a folder which is legal path. "ctrl"+"=" then you will get the message "Bundle loaded successfully." #58

xavierXing commented 7 years ago

Dear author: Hello, I am a Chinese iOS developer, you use plug-in, very easy to use. But I met this phenomenon in a company: my project is named Chinese, which resulted in the report such a mistake will I use the plug-in ( Build Failed with status: 65. You may need to open and edit the bundle project to resolve issues with either header include paths or Frameworks the bundle links against. 

 at /Users/LeoTai/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/common.pm line 61.
 main::error('Build Failed with status: 65. You may need to open and edit t...') called at /Users/LeoTai/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/injectSource.pl line 521
 Bundle build failed ) is named because Chinese caused specific? What do you recommend? Very much look forward to your reply!

GrayLand119 commented 7 years ago

@xxxinghao
After Inject Source in a Chinese named project, I see this debug info in Injection Console: CompileC build/InjectionBundle.build/Debug-iphonesimulator/InjectionBundle.build/Objects-normal/x86_64/BundleContents.o BundleContents.m normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler export LANG=en_US.US-ASCII ... And injectSource.pl use utf8, but llvm complier's language is US-ASCII. I guess encode all paths with ASCII before build in injectSource.pl -line 441 maybe can solve this issue.