2016-11-22 89 views
0

我有一个项目存储在Github和链接到特拉维斯 CI。这种组合起作用。现在我试图将这个代码部署到Heroku。然而,我要推的Heroku(与git push heroku master)正在返回我这个错误:Git/Heroku:没有找到SDK位置

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

你刚刚在.travis.yml文件的末尾运行git push heroku master在测试之后?或者你在单独的deploy:步骤中运行它?

您是否尝试过使用Travis CI Heroku deployment addon而不是通过git push进行部署?也许这将工作。