2

Something seems to be wrong with the anchor-spl crate (v0.25.0). When I add the following dependencies to my anchor project it breaks the build:

[dependencies]
anchor-lang = "0.25.0"
anchor-spl = "0.25.0"

[dev-dependencies]
solana-program-test = "=1.10.38"

Throwing the following error:

error: failed to select a version for `spl-associated-token-account`.
    ... required by package `anchor-spl v0.25.0`
    ... which satisfies dependency `anchor-spl = "^0.25.0"` of package `my_project v0.1.0 (/Users/my_local/my_project/programs/sol_games)`
versions that meet the requirements `~1.0.3` are: 1.0.5, 1.0.3

all possible versions conflict with previously selected packages.

  previously selected package `spl-associated-token-account v1.1.1`
    ... which satisfies dependency `spl-associated-token-account = "=1.1.1"` of package `solana-transaction-status v1.10.38`
    ... which satisfies dependency `solana-transaction-status = "=1.10.38"` of package `solana-client v1.10.38`
    ... which satisfies dependency `solana-client = "=1.10.38"` of package `solana-banks-server v1.10.38`
    ... which satisfies dependency `solana-banks-server = "=1.10.38"` of package `solana-program-test v1.10.38`
    ... which satisfies dependency `solana-program-test = "=1.10.38"` of package `my_project v0.1.0 (/Users/my_local/my_project/programs/sol_games)`

failed to select a version for `spl-associated-token-account` which could resolve this conflict

I have tried adding spl-associated-token-account = "1.0.5" to the dependencies but it also break the build. Any idea how to fix this?

1 Answer 1

2

The build error tells you that solana-program-test = "=1.10.38" requires spl-associated-token-account 1.1.1, but anchor requires 1.0.5, so you'll have to drop solana-program-test to a lower version that also requires 1.0.5. If you want to be lazy you can do:

[dev-dependencies]
solana-program-test = "1.10"

And let cargo figure it out. And if that doesn't work, try "1.9".

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.