Closed FelixLisczyk closed 1 year ago
Hi, this isn't expected behaviour. It can happen when your code compiles but does not load with InjectionLite and it keeps retrying. I'm traveling at the moment and won't be able to fix it for a few weeks. If it's bothering you remove this line from your clone of the project but that doesn't solve the underlying problem which is related to trying to inject code that uses a default value for a function parameter newValue
. Either expand out the parameter from its default or use one of the bundles from the InjectionIII app which is the more supported option and has additional code to handle this situation (a.k.a. unhiding).
default argument 0 of (extension in TinyViews):SwiftUI.Color.desaturated(newValue: Swift.Double) -> SwiftUI.Color
I've pushed a quick patch to prevent the infinite loop but it is untested if you want to give it a try. To prevent the dlopen failure using the default argument of the desaturated() function, either expand out the default argument or use the InjectionIII app. Let me know how you get on.
Thank you very much for your advice!
I've pushed a quick patch to prevent the infinite loop but it is untested if you want to give it a try.
Yes, this fix stops the loop after two iterations.
To prevent the dlopen failure using the default argument of the desaturated() function, either expand out the default argument
That works, thank you!
or use the InjectionIII app.
The InjectionIII app (version 4.7.2) produces a similar error message but no infinite loop.
π Compiling SourceFile.swift
π Selecting Xcode /Applications/Xcode-15.0.0-Beta.6.app/Contents/Developer
π Loading .dylib ...
π β οΈ dlopen() error: dlopen(~/Library/Developer/CoreSimulator/Devices/3344ADB7-20E3-4F13-BE6C-CCCEF11161FA/data/Containers/Data/Application/611C8607-DCAC-4308-B157-966636045E3E/tmp/eval101.dylib, 0x0002): symbol not found in flat namespace '_$s7SwiftUI5ColorV9TinyViewsE11desaturated8newValueACSd_tFfA_'
π β οΈ Loading .dylib has failed, This is likely because Swift code being injected refers to a function with a default argument 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.
This is not a priority issue, and I can easily work around it. Please take your time and enjoy your trip. π
Hi, the real solution here is to add the "unhide" functionality to this repo though as it only comes up only rarely, I'd like to keep this rep as straightforward as possible.
Hi,
Thanks for the great package! I've noticed an endless loop in my terminal. When
InjectionLite
fails to inject my changes, it retries the compilation every few seconds. That doesn't happen with the standaloneInjectionIII.app
. Here is an excerpt from my terminal:Notice that
eval1.dylib
is incremented with each iteration. (eval2.dylib
,eval3.dylib
, etc.) Is this expected behavior?