【问题标题】:Travis pr failed, push passedTravis pr 失败,推送通过
【发布时间】:2018-03-28 23:00:10
【问题描述】:

该分支之前可以正常工作,然后合并到 master 并且 master 上的构建失败。 Master 被还原,然后 master 被合并到这个分支中并进行了一些修复。尝试合并回 master 时,构建再次失败并出现以下错误。 push通过了,pr失败了。

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.squareup.leakcanary:leakcanary-android:1.5.4.

travis.yml 文件:

sudo: false
language: android
android:
components:
- build-tools-27.0.2
- android-27
- sys-img-armeabi-v7a-android-27

jdk:
- oraclejdk8


before_install:
- yes | sdkmanager "platforms;android-27"
- chmod +x gradlew


#First app is built then unit tests are run
jobs:
include:
- stage: build
  async: true
  script: ./gradlew assemble
- stage: test
  async: true
  script: ./gradlew -w runUnitTests


  notifications:
  email:
  recipients:
  - email@me.com

  on_success: always # default: change
  on_failure: always # default: always 

【问题讨论】:

    标签: testing automated-tests travis-ci travis-ci-cli


    【解决方案1】:

    我今天感觉 maven repo 中断并面临同样的问题。几个小时后,我发现失败的 Travis Job 现在可以正常工作了。一定要在你身边检查。

    此外,对于缺少类路径依赖项的任何给定场景,应检查build.gradle 文件而不是.travis.yml 文件。

    失败消息表明,在查找 com.squareup.leakcanary:leakcanary-android:1.5.4(jar 或 AAR)时,app:debugCompileClasspath 任务失败。 Gradle 允许您在根级别定义存储库 allProjects{ repositories { maven() //Gradle has definition the points to https://jcenter.bintray.com/ } }

    所以它会在以下位置查找类文件或 jar 文件。 Name: $ANDROID_HOME/extras/m2repository; url: file:/$ANDROID_HOME/extras/m2repository/ Name: $ANDROID_HOME/extras/google/m2repository; url: $ANDROID_HOME/extras/google/m2repository/ Name: $ANDROID_HOME/extras/android/m2repository; url: file:$ANDROID_HOME/extras/android/m2repository/ Name: BintrayJCenter; url: https://jcenter.bintray.com/

    如果未找到,则依赖解析将失败,并出现上述错误。

    【讨论】:

      猜你喜欢
      • 2020-01-29
      • 1970-01-01
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-11
      相关资源
      最近更新 更多