zyro / elixir-uuid

UUID generator and utilities for Elixir
Apache License 2.0
361 stars 84 forks source link

could not find an app file at "_build/prod/lib/uuid/ebin/uuid.app" #33

Closed sailxjx closed 6 years ago

sailxjx commented 6 years ago

When compiled at the first time I met this error

Unchecked dependencies for environment prod:
* uuid (Hex package)
  could not find an app file at "_build/prod/lib/uuid/ebin/uuid.app". This may happen if the dependency was not yet compiled, or you specified the wrong application name in your deps, or the dependency indeed has no app file (then you can pass app: false as option)
** (Mix) Can't continue due to errors on dependencies

Rerun the compile will get a warning but everything goes right

warning: redefining module UUID (current version loaded from /Users/tristan/Coding/Teambition/private-manager/_build/prod/lib/elixir_uuid/ebin/Elixir.UUID.beam)
  lib/uuid.ex:1

What happened?

elixir version: 1.6.6 uuid version: 1.2

lpil commented 6 years ago

Also having this problem. Is there a fix?

zyro commented 6 years ago

@sailxjx @lpil The app name is now elixir_uuid rather than just uuid. If you've updated this and you still get errors can I pull a project from somewhere to test locally?

sailxjx commented 6 years ago

I can provide the deps

defp deps do
    [
      {:phoenix, "~> 1.3.2"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_ecto, "~> 3.2"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.10"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:cowboy, "~> 1.0"},
      {:elixir_uuid, "~> 1.2"},
      {:phoenix_swagger, github: "xerions/phoenix_swagger"},
      {:guardian, "~> 1.1.0"},
      {:logger_file_backend, "~> 0.0.10"},
      {:porcelain, "~> 2.0"},
      {:quantum, github: "quantum-elixir/quantum-core"},
      {:timex, "~> 3.0"},
      {:yaml_elixir, "~> 2.1"},
      {:tesla, "~> 1.1"},
      {:jason, ">= 1.0.0"},
      {:mock, "~> 0.3", only: :test},
      {:excoveralls, "~> 0.8", only: :test}
    ]
  end
zyro commented 6 years ago

Based on mix deps.tree it seems the problem there is guardian:

...
├── guardian ~> 1.1.0 (Hex package)
│   ├── jose ~> 1.8 (Hex package)
│   │   └── base64url ~> 0.0.1 (Hex package)
│   ├── phoenix ~> 1.0 or ~> 1.2 or ~> 1.3 (Hex package)
│   ├── plug ~> 1.3.3 or ~> 1.4 (Hex package)
│   ├── poison ~> 2.2 or ~> 3.0 (Hex package)
│   └── uuid >= 1.1.1 (Hex package)
...

Depends on uuid but I had a quick glance at their dependencies and it doesn't seem to be declared anywhere, so possibly an odd transitive dependency?

Until guardian either updates to elixir_uuid, fixes the dependency declaration/packaging, or otherwise drops uuid entirely you can probably work around it by adding {:uuid, "~> 1.1"} to your dependencies manually.

sailxjx commented 6 years ago

Seems they fixed this problem in the master branch of repo, but had not released in the newest version.

https://github.com/ueberauth/guardian/commit/3e6fb329aa46c7b2fe890d60f882af8d7470a5e1