Closed tvidenov closed 9 months ago
Since the introduction of ReducerProtocol
you can use Inject with TCA without support code. It's important to add the "Other Linker Flags": -Xlinker -interposable though.
Ok, so I obviously do something wrong but can't figure it out yet:
`π Compiling /.../Settings.swift
π Loading .dylib ...
π β οΈ dlopen() error: dlopen(/Users/.../Library/Developer/CoreSimulator/Devices/DA06D4B2-5CE7-4262-BA0D-CDD77CFA337F/data/Containers/Data/Application/EA7F2C38-392A-474E-800B-6CE929C7C732/tmp/eval101.dylib, 0x0002): Library not loaded: @rpath/libswift_Concurrency.dylib
Referenced from:
Thatβs unusual and probably not related to using TCA. Can you supply more details of your environment? macOS version, Xcode and iOS target version etc.
Yes, sorry. Should have provided it in the first place: The project was based on TCA 1.6.0 but now is 1.7.0 Target: iOS17 Xcode 15.2 macOS: Sonoma 14.3
I will try to make an example app to see if I can reproduce it.
Interesting, TCA uses Concurrency (libswift_Concurrency.dylib) which is in a different directory so I may need to adjust the "rpath". Any chance you have a small example project setup showing the problem? This would save me a lot of time fixing it.
Can you try adjusting your project's "Runpath Search Paths" to include /Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/iphonesimulator ?
Here's a simple project - https://github.com/tvidenov/tca-inject
Thanks for that but I get: No such module 'AppFeature'
. Am I holding it wrong?
Sorry, didn't commit everything as I was in a hurry. I actually made it working on this example project, so this means it is something off with my main.
Thatt's good news for InectionIII I guess. Did you try the "Runpath Search Paths" suggestion?
I am also getting similar issue on my end:
π Compiling /Users/.../.../HotReloadExample/HotReloadExample/ContentView.swift
π Loading .dylib ...
π β οΈ dlopen() error: dlopen(/Users/.../Library/Developer/CoreSimulator/Devices/5D4024F3-9D68-45AA-82AF-294AD3CC1A44/data/Containers/Data/Application/43FF81B8-2D8D-40E5-A992-9DED9E30C188/tmp/eval101.dylib, 0x0002): symbol not found in flat namespace '_$s7SwiftUI4ViewP6InjectE15enableInjectionQryFQOMg'
π β οΈ Loading .dylib has failed, This is likely because Swift code being injected references a function using a default argument or a member with access control that is too restrictive or perhaps an XCTest that depends on code not normally linked into your application. Rebuilding and re-running your project (without a build clean) can resolve this.
How can I resolve this?
Hi, that's probably related to something unrelated to do with symbol visibility called "unhiding" which should have run in the background when you get this error. If you restart your app and try again does it go away?
Hi, that's probably related to something unrelated to do with symbol visibility called "unhiding" which should have run in the background when you get this error. If you restart your app and try again does it go away?
Hmmm that's weird.. I am pretty sure I restarted the test app I did yesterday, and it did not go away, but today it did! Yeah now it works. Thanks!
Can we use it with the latest version of TCA (1.6.0) and how? I saw there is a little mentioned in the readme about the fork of The Browser Company, but it is very hard to navigate.