No default language could be detected for this app.

You might get this error after you push a python git repository to Heroku. It happened to me when I submitted the following command:

$ git push heroku master

OUTPUT:

remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 19fca4f3808b4632d66
remote: !
remote: ! We have detected that you have triggered a build from source code with version 19bcaa6f99a7e78ca4f3808b4632d66
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to castingapp-20201101.
remote:
To https://git.heroku.com/castingapp.git

SOLUTION:

  1. You will need to include a Pipfile in your root repository (if you are using other language, you may need a package.json)
  2. I would recommend that you also include a runtime.txt file with the python version
  3. Find more information at https://devcenter.heroku.com/articles/python-runtime

Done.