我有一个存储在 Github 中的项目,并链接到CI的 Travis 。这种组合有效。现在我正在尝试将此代码部署到 Heroku 。但是,我推送到Heroku(git push heroku master
)正在给我这个错误:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: A problem occurred configuring project ':app'.
remote: > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
remote:
remote: * Try:
remote: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
remote:
remote: BUILD FAILED
remote:
remote: Total time: 40.505 secs
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to (projectName).
remote:
To https://git.heroku.com/(projectName).git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/(projectName).git'
它说我需要区分 location.properties 文件中的SDK位置。
好吧,我怎么能这样? Travis是否会在每次构建时自动安装SDK?我怎么能指出一些恐怖的东西?
我错过了什么?
答案 0 :(得分:0)
您是否只是在测试后的git push heroku master
文件末尾运行.travis.yml
?或者您是在单独的deploy:
步骤中运行它?
您是否尝试过使用Travis CI Heroku deployment addon而不是通过git push
进行部署?也许那会奏效。