Travis fails to build Android project, no local.properties

邮差的信 提交于 2019-12-12 02:29:23

问题


Here is the thing. I've built my project on the Travis CI several times, but got the same problem every time.

The error log:

What went wrong: A problem occurred evaluating root project 'LiteReader'. /home/travis/build/Mindjet/LiteReader/local.properties (No such file or directory)

It's true that the project I uploaded has no local.properties, I've excluded it because it contains information specific to local configuration.

It's my .travis.yml

language: android
cache: bundler

android:
  components:
    - tools
    - build-tools-25.0.2
    - android-25
    - extra-android-m2repository
    - extra-android-support

before_install:
  - chmod +x gradlew

script:
      ./gradlew checkstyle build

How can I solve this problem? Please help, Thanks.


回答1:


A bit late to the party, but I ran into the same issue and found a simpler solution:

before_script:
  - touch local.properties

This will create the file, before running the script, but without the need to create and add a "fake" file into your project.




回答2:


I am using CircleCI instead of Travis but I had the same problem :) I fixed it like this, it should do the trick for you, if you can do something like that in Travis (I don't see a reason why you couldn't).

TL;DR

  1. Create the "local.properties.ci" in the same directory of "local.properties"
  2. Put fake data in it so the CI build can pass
  3. Add it to Git
  4. Add the code below in circle.yml:

checkout: post: - cp local.properties.ci local.properties



来源:https://stackoverflow.com/questions/42827701/travis-fails-to-build-android-project-no-local-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!