Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error Library not loaded etrace #81

Open
msdrigg opened this issue Mar 24, 2024 · 5 comments
Open

Getting error Library not loaded etrace #81

msdrigg opened this issue Mar 24, 2024 · 5 comments

Comments

@msdrigg
Copy link

msdrigg commented Mar 24, 2024

I added ETrace via SPM to my iOS (swift-only) app in XCode. Now when I run my app, it fails to boot with this error:

dyld[5492]: Library not loaded: @rpath/ETTrace.framework/ETTrace
  Referenced from: <E2B8FCBC-9CB0-36CA-9146-C1447F66E554> /private/var/containers/Bundle/Application/D12861D7-F626-41AB-BC18-28457F218810/App.app/App
  Reason: tried: '/Users/me/Library/Developer/Xcode/DerivedData/App-cklguuvlmfepaxaevnzjgkgtwzmc/Build/Products/Debug-iphoneos/PackageFrameworks/ETTrace.framework/ETTrace' (no such file), '/private/preboot/Cryptexes/OS/Users/me/Library/Developer/Xcode/DerivedData/App-cklguuvlmfepaxaevnzjgkgtwzmc/Build/Products/Debug-iphoneos/PackageFrameworks/ETTrace.framework/ETTrace' (no such file), '/private/var/containers/Bundle/Application/D12861D7-F626-41AB-BC18-28457F218810/Frameworks/ETTrace.framework/ETTrace' (no such file), '/Users/me/Library/Developer/Xcode/DerivedData/App-cklguuvlmfepaxaevnzjgkgtwzmc/Build/Products/Debug-iphoneos/PackageFrameworks/ETTrace.framework/ETTrace' (no such file), '/private/preboot/Cryptexes/OS/Users/me/Library/Developer/Xcode/DerivedData/App-cklguuvlmfepaxaevnzjgkgtwzmc/Build/Products/Debug-iphoneos/PackageFrameworks/ETTrace.framework/ETTrace' (no such file), '/private/var/containers/Bundle/Application/D12861D7-F626-41AB-BC18-28457F218810/Frameworks/ETTrace.framework/ETTrace' (no such file)

Things I've tried:

  • Making sure I have set "ETrace to 'Embed & Sign'
  • Playing around with "Destination" in Build Phases -> Embed Frameworks (I tried "Frameworks", "Shared Frameworks" and "Products Directory"

Here are screenshots of the relevant sections:

Screenshot 2024-03-24 at 7 23 19 PM Screenshot 2024-03-24 at 7 24 04 PM

The weirdest thing is that if I look in /Users/me/Library/Developer/Xcode/DerivedData/App-cklguuvlmfepaxaevnzjgkgtwzmc/Build/Products/Debug-iphoneos/PackageFrameworks/ETTrace.framework/ETTrace (the first path that it says it tried), I can see that ETTrace actually does exist.

@noahsmartin
Copy link
Member

Hey @msdrigg the framework should be in your apps framework folder to be used, so MyApp.app/Frameworks, it looks like it's in a different path based on your description so please make sure your Xcode settings have it copied into the app's frameworks folder

@noahsmartin
Copy link
Member

Also ETTrace is a dynamic framework not static, yet in the screenshots you posted the icon Xcode displays is an icon for a static framework

@msdrigg
Copy link
Author

msdrigg commented Mar 25, 2024

Any pointers as to what I should google to figure out how to change the right configuration parameters?

I tried googling the error with no helpful results

@noahsmartin
Copy link
Member

@msdrigg maybe a delete derived data and restart Xcode? When I add the target to my app I only see the dynamic framework option, in the Package.swift we only have the product be a dynamic framework:

    products: [
        .library(
            name: "ETTrace",
            type: .dynamic,
            targets: ["ETTrace"]
        ),

@msdrigg
Copy link
Author

msdrigg commented Mar 27, 2024

Hmm I tried that and still seeing the same icon. Could it be an XCode 15.3 thing? I only started this app a few months ago and have the xcode package format updated to the latest.

This should be reproducible here https://github.com/msdrigg/Roam/tree/ETTRace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants