siteline / swiftui-introspect

Introspect underlying UIKit/AppKit components from SwiftUI
MIT License
5.68k stars 352 forks source link

Library not loaded: @rpath/SwiftUIIntrospect.framework/SwiftUIIntrospect on Device #375

Closed waelsaad closed 1 year ago

waelsaad commented 1 year ago

Description

When I run my app on simulator it works fine but when I try to run it on iPhone XS Max iOS 16.6 it crashed. I have multiple SPM referenced, it only complains about SwiftUIIntrospect.

I am using the latest Xcode Version 15.0 (15A240d) and latest SwiftUI-intospect 1.1.0, Latest MacOS.

I have read thru existing issues, this one might be simillar but not the same issue I am having https://github.com/siteline/swiftui-introspect/issues/318

Perhaps its the same but I couldn't see where I could do embed and sign !.

Here is a screenshot

Screenshot 2023-10-05 at 10 00 26 pm

Here is the output

dyld[6386]: Library not loaded: @rpath/SwiftUIIntrospect.framework/SwiftUIIntrospect
  Referenced from: <E7DFC3A6-9F7D-3FD1-9320-08AE3019CDDF> /private/var/containers/Bundle/Application/0777C6B5-7AD6-438F-A74B-DB5AF3856EF5/Test Book.app/Test Book
  Reason: tried: '/Users/X/Library/Developer/Xcode/DerivedData/Test_Book-hbqcoxrnuctfexbxotfqooalucjc/Build/Products/Debug-iphoneos/PackageFrameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file), '/private/preboot/Cryptexes/OS/Users/X/Library/Developer/Xcode/DerivedData/Test_Book-hbqcoxrnuctfexbxotfqooalucjc/Build/Products/Debug-iphoneos/PackageFrameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file), '/private/var/containers/Bundle/Application/0777C6B5-7AD6-438F-A74B-DB5AF3856EF5/Test Book.app/Frameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file), '/Users/X/Library/Developer/Xcode/DerivedData/Test_Book-hbqcoxrnuctfexbxotfqooalucjc/Build/Products/Debug-iphoneos/PackageFrameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file), '/private/preboot/Cryptexes/OS/Users/X/Library/Developer/Xcode/DerivedData/Test_Book-hbqcoxrnuctfexbxotfqooalucjc/Build/Products/Debug-iphoneos/PackageFrameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file), '/private/var/containers/Bundle/Application/0777C6B5-7AD6-438F-A74B-DB5AF3856EF5/Test Book.app/Frameworks/SwiftUIIntrospect.framework/SwiftUIIntrospect' (no such file)

Thank you,

Wael

Actual behavior

Crashes on device.

Steps to reproduce

Use SPM to reference the package and try to run the app on actual device, it crashes immediatly.

Version information

1.0.0

Destination operating system

iOS 15.0

Xcode version information

Xcode Version 15.0 (15A240d)

Swift Compiler version information

swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0
waelsaad commented 1 year ago

I deleted the SPM and added it to get the latest 1.1.0 and still same issue.

davdroman commented 1 year ago

Just to make sure: are you adding just SwiftUIIntrospect, or are you also adding SwiftUIIntrospect-Dynamic/SwiftUIIntrospect-Static? Neither of the latter two should be needed for 99% of apps and will cause these types of issues.

waelsaad commented 1 year ago

Thanks @davdroman for response but as you can see from my screenshot above I am removing both Dynamic and Static.

davdroman commented 1 year ago

Okay thanks for confirming. Is there any chance you could share a small reproducible project (either as a zip archive or a link to a repo) so I can try and figure out what's wrong? It's hard to tell what the issue is otherwise.

waelsaad commented 1 year ago

Thank you for asking. as I was preparing for you a sample project, I found that after I removed a whole bunch of code from my app a very basic app version deployed successfully to device hmmm so I am not sure what the problem it is yet because I have lots of code. There must be something clashing with it I only removed code, I didn't changed project settings. give me sometime to go thru it again and I will get back to you. Thanks.

waelsaad commented 1 year ago

I don't know what just happened, I deleted the modified project and unzipped my main project again and it worked. It was fixed by itself. I have no idea, maybe my only suspicious thought was that yesterday I was using v1.0.0 but even after updating to v1.1..0 it was not working but perhaps something was cached in Xcode even after I did clean everything so this morning I closed the project and opened it and it works. ofcourse I could be compeletly wrong but it works now. If something comes up I'll let you know. Thanks again.