Travis CI apk路径

时间:2015-10-15 10:47:07

标签: android travis-ci

我对Travis CI不是很有经验,所以我无法找到apk路径的正确值来使用它来加载到GitHub版本。

这是我的.travis.yml:

language: android
android:
  components:
    # Uncomment the lines below if you want to
    # use the latest revision of Android SDK Tools
    # - platform-tools
    # - tools

    # The BuildTools version used by your project
    - build-tools-22.0.1

    # The SDK version used to compile your project
    - android-23

    # Additional components
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository
    - addon-google_apis-google-19

    # Specify at least one system image,
    # if you need to run emulator(s) during your tests
    - sys-img-armeabi-v7a-android-19
    - sys-img-x86-android-17

    # Emulator Management: Create, Start and Wait
    before_script:
      - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
      - emulator -avd test -no-skin -no-audio -no-window &
      - android-wait-for-emulator
      - adb shell input keyevent 82 &

    deploy:
      provider: releases
      api_key: "****"
      file: "/app/build/outputs/app-release.apk"
      skip_cleanup: true
      on:
        tags: true

对于未标记的提交,一切都很好,但是当Travis尝试构建标记的提交时,会发生这样的错误:

Fetching: dpl-1.8.6.gem (100%)
Successfully installed dpl-1.8.6
1 gem installed
dpl.1
Installing deploy dependencies
Fetching: addressable-2.3.8.gem (100%)
Successfully installed addressable-2.3.8
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.9.2.gem (100%)
Successfully installed faraday-0.9.2
Fetching: sawyer-0.6.0.gem (100%)
Successfully installed sawyer-0.6.0
Fetching: octokit-4.1.1.gem (100%)
Successfully installed octokit-4.1.1
5 gems installed
Fetching: mime-types-2.6.2.gem (100%)
Successfully installed mime-types-2.6.2
1 gem installed
dpl.2
Preparing deploy
Logged in as Evgenii
Deploying to repo: evgenii-kanivets/pickup_teams
Current tag is: v0.01
dpl.3
Deploying application
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-4.1.1/lib/octokit/client/releases.rb:86:in `initialize': No such file or directory - /app/build/outputs/app-release.apk (Errno::ENOENT)
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-4.1.1/lib/octokit/client/releases.rb:86:in `new'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-4.1.1/lib/octokit/client/releases.rb:86:in `upload_asset'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/provider/releases.rb:118:in `block in push_app'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/provider/releases.rb:102:in `each'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/provider/releases.rb:102:in `push_app'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/provider.rb:143:in `block in deploy'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/cli.rb:41:in `fold'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/provider.rb:143:in `deploy'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/cli.rb:32:in `run'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/lib/dpl/cli.rb:7:in `run'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.6/bin/dpl:5:in `<top (required)>'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `load'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `<main>'
failed to deploy

所以我认为通往aps的道路并不正确。有人可以帮我找出正确的吗?

1 个答案:

答案 0 :(得分:3)

我从来没有使用过特拉维斯,但我在这里看到了我的答案(Android工作室):

app/build/outputs/apk/

This article似乎证实了这一点

file: app/build/outputs/apk/app-release.apk

找到related issue,但您已经跳过清理:

skip_cleanup: true