krzysztofzablocki / Inject

Hot Reloading for Swift applications!
MIT License
2.36k stars 118 forks source link

Xcode package integration not working #75

Closed crash481 closed 1 year ago

crash481 commented 1 year ago

Hello, I trying to integrate you great solution And it worked good via CocoaPods

But when I trying to integrate it via Xcode 14.3 package manager I get an error in console on same project

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/SwiftTrace.framework/SwiftTrace
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: Incompatible library version: iOSInjection requires version 1.0.0 or later, but SwiftTrace provides version 0.0.0

Please, can you explain how can I fix it? Project is swift UIKit, and it work good with CocoaPod integration

As I clearly understand your project using https://github.com/johnno1962/InjectionIII, but it needs to force reload UIView and UIViewController when that lib calls Injected callback. And this your project doing it by wrapping to Host. Am I right?

And also, do you know this project of InjectionForXcode owner https://github.com/johnno1962/HotReloading ? If it is doing the same as your project, of for what it is?

crash481 commented 1 year ago

Oh I fixed it Moving my project out of "/Documents" directory But it is strange, that it is working with CocoaPods in "/Documents" directory

If there some fixes or workarounds for making it work in "/Documents" directory? P.S. questions about HotReloading project is still actual, help me please to clearly understand it

johnno1962 commented 1 year ago

Hi, there are some problems when you try to use injection with a project inside the ~/Documents directory as it has special permissions. It can work but it is never clear why and is best avoided.

crash481 commented 1 year ago

And there is no ways to fix problems with "~/Documents"?

I more then 7 years using this folder to store my different projects, you think I need to change locations?

johnno1962 commented 1 year ago

It has caused people problems in the past. Basically, as I say, having your project in that directory is best avoided.