How to force the soap plug to use new httpoison

Hello, when I want to install Saop library , it shows me an error like this:

Resolving Hex dependencies...

Failed to use "httpoison" (version 1.3.0) because
  soap (version 0.1.1) requires ~> 0.13
  mix.lock specifies 1.3.0

** (Mix) Hex dependency resolution failed, change the version requirements of your dependencies or unlock them (by using mix deps.update or mix deps.unlock). If you are unable to resolve the conflicts you can try overriding with {:dependency, "~> 1.0", override: true}

after this error, I was trying to install it like this:

  defp deps do
    [
      {:httpoison, "~> 1.3"},
      {:soap, "~> 0.1.1", :httpoison, "~> 1.3", override: true},
    ]
  end

but I still have an error:

➜ mix deps.tree
** (Mix) Dependency specified in the wrong format:

    {:soap, "~> 0.1.1", :httpoison, "~> 1.3", [override: true]}

Expected:

    {app, opts} | {app, requirement} | {app, requirement, opts}

Where:

    app :: atom
    requirement :: String.t | Regex.t
    opts :: keyword

If you want to skip the requirement (not recommended), use ">= 0.0.0".

what do I do to fix this?

  defp deps do
    [
      {:soap, "~> 0.1.1"},
      {:httpoison, "~> 1.3", override: true}
    ]
  end

This should be the correct form. Also you should file a bug at the soap issue tracker that they bump their constraints.

3 Likes

@NobbZ Hello, will it be a problem for me ? because I used :httpoison, "~> 1.3" in all of my web app, now if it is been override, I will make a problem in my web app? I mean in other part of mine

I don’t understand why Saop isn’t update in elixir :thinking: all of these have at least one problem.

Well, the alarm release on hex is from beginning of the year, there have been a lot of commits after that. Probably the httpoison bump was among those later commits? They simply need to release a new update. You could use the git version until then.

PS, the old ~>1.0 covers your ~> 1.3 as well, you should be able to use their master branch as is.

1 Like

thank you, at first I forked this lib and update it’s dependencies after that I installed again, but with my repository.

and set this in my config file:

  config :soap, :globals,
      version: 1.2

rep:

{:soap, "~> 0.1.2", github: "shahryarjb/soap"}