injectionforxcode icon indicating copy to clipboard operation
injectionforxcode copied to clipboard

renaming bundle so it reloads..

Open bigParis opened this issue 8 years ago • 7 comments

When I run a simple demo project, It can be injected successfully, but when I test it on a big project it not works. I got messages from injection console as below

** RECORDED BUILD SUCCEEDED **

Renaming bundle so it reloads..
rm -rf "/Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle" && cp -r "/Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle.bundle" "/Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle"
Loading Bundle...
Modified iOSInjectionProject/injectionCount.txt ...

*** Bundle load failed ***
Consult the Xcode console.

But I open InjectionBundle.xcodeproj and it can be build successfully, how to fix this problem?

bigParis avatar Mar 12 '16 03:03 bigParis

The problem is in the loading of the bundle. Look at the debug console in Xcode to look for dynamic loading errors.

johnno1962 avatar Mar 12 '16 15:03 johnno1962

@johnno1962 Error loading /Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle: dlopen(/Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle, 265): Symbol not found: OBJC_CLASS$_MFAlertView Referenced from: /Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle Expected in: flat namespace in /Users/yy/Desktop/makefriends/makefriends-ios_requirement_feature/proj.ios_mac/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle

This is the message shown in debug console, MFAlertView is a self-defined component, Injection will not work with self-defined component, or how can I load injectionBundle in a right way?

bigParis avatar Mar 14 '16 01:03 bigParis

That should work. Look for something affecting the visibility of that class in the source i.e. https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

johnno1962 avatar Mar 14 '16 01:03 johnno1962

@johnno1962

Bundle load failed

** RECORDED BUILD SUCCEEDED **

Renaming bundle so it reloads..
rm -rf "/Users/mtt0123/penghao/TechGitLab/MTCamera/MTCameraMoudleDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle6.bundle" && cp -r "/Users/mtt0123/penghao/TechGitLab/MTCamera/MTCameraMoudleDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle.bundle" "/Users/mtt0123/penghao/TechGitLab/MTCamera/MTCameraMoudleDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle6.bundle"
Loading Bundle...
Modified iOSInjectionProject/injectionCount.txt ...

*** Bundle load failed ***
Consult the Xcode console.


ph661 avatar Mar 17 '16 02:03 ph661

Look at your Xcode console for the error this time.

johnno1962 avatar Mar 17 '16 02:03 johnno1962

** RECORDED BUILD SUCCEEDED **

Renaming bundle so it reloads..
rm -rf "/Users/Terry/WorkSpace/QYGithub/QYDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle12.bundle" && cp -r "/Users/Terry/WorkSpace/QYGithub/QYDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle.bundle" "/Users/Terry/WorkSpace/QYGithub/QYDemo/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle12.bundle"
Codesigning with identity '-' for iOS device
Loading Bundle...
Modified iOSInjectionProject/injectionCount.txt ...

*** Bundle load failed ***
Consult the Xcode console.

And Nothing in Console

zhangqingyv avatar Apr 28 '17 03:04 zhangqingyv

Are you trying to use on a device? That no longer works I’m afraid.

johnno1962 avatar Apr 28 '17 08:04 johnno1962