injectionforxcode icon indicating copy to clipboard operation
injectionforxcode copied to clipboard

*** Bundle has failed to load

Open dollar2048 opened this issue 8 years ago • 17 comments

Hello, John. Please, help. During injection I'm receiving such error: Xcode console log:

Compiling /Users/sergei.prikhodko/PR/Project/ProjectLive/Code/Managers/NetworkStatusManager.m 0.05 real 0.03 user 0.01 sys 2016-10-10 10:20:48.948 Project[9481:140869] Error loading /Users/sergei.prikhodko/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle5.bundle/InjectionBundle: dlopen(/Users/sergei.prikhodko/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle5.bundle/InjectionBundle, 265): Library not loaded: @rpath/AFNetworkActivityLogger.framework/AFNetworkActivityLogger Referenced from: /Users/sergei.prikhodko/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle5.bundle/InjectionBundle Reason: image not found 2016-10-10 10:20:48.949 Project[9481:140869] Bundle Load Error 2016-10-10 10:20:48.949 Project[9481:141010] *** Bundle has failed to load. If this is due to symbols not found, this may be due to symbols being hidden from dynamic libraries. *** 4 injections performed so far.

Where shall I have a look?

dollar2048 avatar Oct 10 '16 08:10 dollar2048

You’ll likely have to adjust the “Runpath Search Paths” of your injection bundle.

johnno1962 avatar Oct 10 '16 19:10 johnno1962

John, could you give an example of how to modify those paths? I've installed Google/SignIn via cocoapods and can no longer inject with the error:

ld: framework not found GGLSignIn for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)



** BUILD FAILED **




The following build commands failed:
 Ld build/Debug-iphonesimulator/InjectionBundle.bundle/InjectionBundle normal x86_64
(1 failure)



*** 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. ***


timothycosta avatar Oct 25 '16 05:10 timothycosta

@johnno1962 I works inly when I "patch project for injection". otherwerwise xcode console says:

Error loading /Users/user/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/InjectionLoader.bundle/InjectionLoader:  dlopen(/Users/user/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/InjectionLoader.bundle/InjectionLoader, 265): no suitable image found.  
Did find:
    /Users/user/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/InjectionLoader.bundle/InjectionLoader: required code signature missing for '/Users/user/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/InjectionLoader.bundle/InjectionLoader'

How can I use plugin without modification in main.m and .pch files?

dollar2048 avatar Oct 25 '16 08:10 dollar2048

Hi @dollar2048, you still have a problem where the InjectionLoader boostrap bundle isn’t signed correctly. Please build from the sources and alter the codesigning identity in the Build Phase until it is not giving an error. A build from Alcatraz will not report this error. Then you shouldn’t need to patch.

johnno1962 avatar Nov 02 '16 01:11 johnno1962

Hi, @johnno1962 . Yes. you are right. I have deleted from alcatraz then build the injection project it manually (with evident signing instead of "iPhone Developer"). and it fixed the problem. I don't have to patch my project to apply injection :) Thank you again.

dollar2048 avatar Nov 07 '16 09:11 dollar2048

@johnno1962 It came back again (it doesn't work even if I build the plugin using xcode):

2016-11-09 14:35:03.102 Project[1642:10843608] Error loading /Users/user/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle:  dlopen(/Users/user/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Users/user/PR/Project/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle
  Reason: image not found
2016-11-09 14:35:03.102 Project[1642:10843608] Bundle Load Error
2016-11-09 14:35:03.102 Project[1642:10843757] *** Bundle has failed to load. If this is due to symbols not found, this may be due to symbols being hidden from dynamic libraries. ***
82 injections performed so far.

what could I do?

dollar2048 avatar Nov 09 '16 13:11 dollar2048

Alcatraz may have rebuilt your rebuilt your plugin? Try building it manually again?

johnno1962 avatar Nov 09 '16 16:11 johnno1962

@johnno1962 I have removed it from Alcatraz. Then build it manually. Still this problem.

what does this mean? Library not loaded: @rpath/XCTest.framework/XCTest

dollar2048 avatar Nov 09 '16 16:11 dollar2048

I’m sorry, but I don’t know. Which Xcode is this??

johnno1962 avatar Nov 09 '16 16:11 johnno1962

xcode 8.1 and I think it happens after upgrading to it.

I'll check on another machine if it works there.

dollar2048 avatar Nov 09 '16 16:11 dollar2048

same problem

Library not loaded: @rpath/XCTest.framework/XCTest

Details:

2016-11-27 00:53:36.034 xxy[51329:3837555] Error loading /Users/ooops/Documents/Xcode/Projects/xxx/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle8.bundle/InjectionBundle:  dlopen(/Users/ooops/Documents/Xcode/Projects/xxx/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle8.bundle/InjectionBundle, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Users/ooops/Documents/Xcode/Projects/xxx/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle8.bundle/InjectionBundle
  Reason: image not found
2016-11-27 00:53:36.034 xxy[51329:3837555] Bundle Load Error
2016-11-27 00:53:36.035 xxy[51329:3838456] *** Bundle has failed to load. If this is due to symbols not found, this may be due to symbols being hidden from dynamic libraries. ***
5 injections performed so far.

yam-liu avatar Nov 26 '16 16:11 yam-liu

After several hours' investigation, I finally make it work for the Library not loaded: @rpath/XCTest.framework/XCTest issue inspired by another similar dyld question.

All you need to do is clear all the derived data (not just your current project). At least this works for me. Hope this helps.

yam-liu avatar Nov 26 '16 19:11 yam-liu

@ooopscc OMG. you are right! Derived data was causing the problem. Thank you so much!!!

p.s. but on Sierra since 8.1 unsigned xcode doesn't work good(( it freezes on saving.

dollar2048 avatar Nov 28 '16 13:11 dollar2048

Hey @dollar2048

Try this and see if that doesn't solve the freezes - https://medium.com/@zenangst/is-unsigned-xcode-giving-you-a-hard-time-cdc30d2c54b3#.rbm382myh

zenangst avatar Nov 28 '16 20:11 zenangst

@zenangst Thank you so much! it helped me! Xcode is great again.

dollar2048 avatar Nov 28 '16 21:11 dollar2048

@johnno1962 I don't know if I should close this issue or leave it as it is now.

dollar2048 avatar Nov 28 '16 21:11 dollar2048

Let’s leave it open for now there is a lot of useful information here, particularly the contacts fix.

johnno1962 avatar Nov 28 '16 22:11 johnno1962