0
votes

I am trying to include ejabberd in elixir app, as described at https://docs.ejabberd.im/developer/extending-ejabberd/elixir/. Everything works, however when I want to create release package from app using mix release, I got error:

** (Mix) :p1_utils is listed both as a regular application and as an included application

Any idea how to solve this? My exs is very simple, just ejabberd with no other deps.

defmodule Ejapp.MixProject do
  use Mix.Project

  def project do
    [
      app: :ejapp,
      version: "0.1.0",
      elixir: "~> 1.9",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:ejabberd, "~> 19.2"}
    ]
  end
end

1
Sidenote: def application, do: [] looks a bit weird; even if compiled, your release will not be robust because it has no application declared. - Aleksei Matiushkin
I'm facing the same issue, did you fix it eventually? - omesi37

1 Answers

0
votes

This happens when your application or one of your dependencies includes p1_utils as an optional dependency (:included_applications) and another dependency does include it as a real dependency (which is the same as explicit including it into the list of :applications in mix project file.)

Since your application does not include it, I would go through all the dependencies of :ejabberd and find a culprit. Usually, the issue might be solved by patching the dependency inside the dependency tree before doing mix release.

I would not consider this being an issue with mix release because even despite :applications is more strict, the dependency might use :included_applications to postpone the custom initialization and there might be a conflict with it being already started from another dependency.