代码之家  ›  专栏  ›  技术社区  ›  pam

Travis pr失败,推送通过

  •  0
  • pam  · 技术社区  · 7 年前

    该分支以前正常工作,然后合并到master,并且在master上的构建失败。Master被还原,然后Master被合并到此分支中,并进行了一些修复。尝试合并回主版本时,生成再次失败,出现以下错误。推送通过,pr失败。

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

    特拉维斯。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 
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Devendra Vaja    7 年前

    我今天感觉maven回购协议中断了,面临着同样的问题。几个小时后,我发现失败的Travis工作现在运行良好。一定要在你身边检查。

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

    故障消息表示 app:debugCompileClasspath 查找时任务失败 com.squareup.leakcanary:leakcanary-android:1.5.4 (jar或AAR)。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/

    如果未找到依赖项解析,则将无法给出上述错误。

    推荐文章