SPM dependency problem only when running tests

Hey guys!
I'm having a weird issue which I cant really understand why is happening.
Our current app is modularised into frameworks and we have just converted the old frameworks to SPM. Everything works well and the whole app is running as it should except for one thing.

We have currently split the app into 24 different packages and it all runs fine, but it wont build for testing on the main app target.
We have a package called ActionsKit which depends on two packages ResourcesKit & CoreKit. ResourcesKit depends on an external package called Lottie and our CoreKit depends on another external package.
Inside the ActionsKit we call some of the functions that make use of these external packages through our CoreKit and ResourcesKit and it runs fine, but when we run tests, we get the error of undefined symbol: nominal type descriptor for Lottie.AnimationView.

So, what I dont understand is that this error does not occur when running the test in the ActionsKit scheme, but when I choose the app scheme and run the tests it gives me this error.

The weird thing is also that Xcode wants me to also import and add the Lottie package to the app's target, even though its only ResourcesKit that depends on it.

Any ideas on what the problem may be?

Thanks in advance!