criticalmaps / criticalmaps-ios

Critical Maps iOS App 🚲✊
http://www.criticalmaps.net
MIT License
281 stars 40 forks source link

I couldn't build the packages, is it the SPM issue? #496

Closed zzmasoud closed 9 months ago

zzmasoud commented 9 months ago

Hey everyone, I used to build + test packages successfully with no pain (I guess the last time was Aug), but this time couldn't.

What was the error?

I got "Unknown attribute 'BindingState'" compiler error on every module that has @BindingState. Cleaning and re-fetching packages didn't work.

How did I solve the problem?

Just played around SPM and changed some versions in Package.Swift:

  1. for the "swift-composable-architecture" changed to .upToNextMajor(from: "0.44.0").
  2. for the "composable-core-location" changed to the latest one from: "0.3.0"

Now it's working with TCA 0.59.0 and composable-core-location 0.3.0!

I just want to learn what was going on, is it related to SPM issues (since I heard people got a lot of random errors in the forum), or is the project's configuration wrong?

mltbnz commented 9 months ago

Hi @zzmasoud It sounds like the composable architecture dependency updated to >=1.0.0 when you updated. 1.0 introduces some breaking changes.

zzmasoud commented 9 months ago

@mltbnz Thanks for the information, so it's about some cached packages on my local system, right?

mltbnz commented 9 months ago

Just played around SPM and changed some versions in Package.Swift:

Since you mentioned you changed versions of some packages I was assuming that the version of TCA changed to 1.0.0.

You can see the version of the package you are using in Xcode.

But maybe the package shouldn't allow the dependency version up to next major... might be an issue with the project setup now that 1.0.0 is released. Haven't been doing anything recently

mltbnz commented 9 months ago

I did some work on tca-1.0

You can check it out but I'm not sure if that builds

zzmasoud commented 9 months ago

Thanks for the update, yes it's working fine for me! So, I'm closing this.