Library Not Loaded on startup using Native Reference to HockeySDK RRS feed

  • Question

  • User232349 posted

    This is a repost of sorts of the last comment in this thread: https://forums.xamarin.com/discussion/67130/hockeysdk-for-xamarin-mac#latest

    I have separated this out for clarity as it is actually a different error to the main theme of that thread.

    We are getting an error at startup running any application that has a native reference to the HockeySDK (available at https://download.hockeyapp.net/sdk/mac/HockeySDK-Mac-4.1.0-beta.4.zip)

    The error experienced is

    Process:               HockeySDKApp [4219]
    Path:                  /Users/USER/*/HockeySDKApp.app/Contents/MacOS/HockeySDKApp
    Identifier:            com.companyname.hockeysdkapp
    Version:               ???
    Code Type:             X86-64 (Native)
    Parent Process:        ??? [1]
    Responsible:           HockeySDKApp [4219]
    User ID:               501
    Date/Time:             2016-07-26 13:54:43.449 +1200
    OS Version:            Mac OS X 10.11.5 (15F34)
    Report Version:        11
    Anonymous UUID:        9C85D0A4-2BC6-21CA-6229-41010E7390F3
    Time Awake Since Boot: 11000 seconds
    System Integrity Protection: enabled
    Crashed Thread:        0
    Exception Type:        EXC_BREAKPOINT (SIGTRAP)
    Exception Codes:       0x0000000000000002, 0x0000000000000000
    Exception Note:        EXC_CORPSE_NOTIFY
    Application Specific Information:
    dyld: launch, loading dependent libraries
    DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xamarin Studio.app/Contents/Resources/lib:/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin:/Library/Frameworks/Mono.framework/Libraries:/lib:/usr/lib:/Library/Developer/CommandLineTools/usr/lib:/usr/local/lib
    Dyld Error Message:
      Library not loaded: @rpath/HockeySDK.framework/Versions/A/HockeySDK
      Referenced from: /Users/USER/*/HockeySDKApp.app/Contents/MacOS/HockeySDKApp
      Reason: image not found
    Binary Images:
        0x7fff69c94000 -     0x7fff69ccb25f  dyld (360.22) <A468D85E-D8D6-3461-8C99-49D3B9ACFC63> /usr/lib/dyld

    I have attached a number files to help with the reproduction of this problem.

    First is "HockeySDKXamarin.zip". Running this should show the crash (with errors appearing in ~/Library/Logs/DiagnosticReports) Second is "HockeySDKXCode.zip". This shows HockeySDK.framework loading correctly from an equivalent XCode solution.

    Curiously, if within the XCode solution HockeySDK.framework isn't correctly copied to the Framework folder using a Copy FIles Build Phase, the same exact error as above (as with Xamarin occurs). This would suggest the app coming out of Xamarin cannot find HockeySDK.framework. Expanding the application package does however reveal it is there. Is there a permissions or signing issue?

    Any help appreciated! Andrew

    Wednesday, July 27, 2016 4:38 AM

All replies

  • User35201 posted

    Alright, so unfortunately there are a few paths around mmp, and this use case missed the ones we tested.

    The problem is that we've added assemblies in HockeySDKApp.app/Contents/Frameworks but never informed the final executable of this.

    You can run this command post build to fix this:

    installnametool ./HockeySDKApp.app/Contents/MacOS/HockeySDKApp -addrpath @loaderpath/../Frameworks

    until we get this fixed on our end.

    Wednesday, July 27, 2016 5:44 PM
  • User35201 posted

    Bug - https://bugzilla.xamarin.com/show_bug.cgi?id=42846

    Wednesday, July 27, 2016 5:59 PM
  • User232349 posted

    Thanks @ChrisHamons.

    I can confirm this works.

    For those referencing in the future, I added a "After Build" Custom Command in the Project Options as follows:

    install_name_tool ${TargetDir}/HockeySDKApp.app/Contents/MacOS/HockeySDKApp -add_rpath @loader_path/../Frameworks.

    I think we may be the first people in the history of civilisation to attempt to get HockeyApp for Mac working in Xamarin, so I will upload to github a working solution once we have everything sorted and post the link as a comment here.

    Wednesday, July 27, 2016 9:41 PM
  • User140121 posted

    @llevera Hi!

    We also working on mac app with Xamarin and would like to have HockeyApp integrated. Do you have any success with binding library?

    Sunday, July 9, 2017 1:41 PM