java – 将gradle更新为2.10,现在travis无法找到我的测试
作者:互联网
我想这是travis-ci的支持?我是从他们的网站发送到这里的.我想我应该在这里问这个问题.
所以我将Google Analytics添加到我的应用中,为此,我必须将gradle更新为版本2.10以获取其插件.完成后,所有travis-ci都运行了我的构建,但是每次构建时都会出现以下错误:
com.android.builder.testing.ConnectedDevice > No tests found.[test(AVD) - 5.0.2] FAILED
当我使用gradle2.2.1时,这不是问题.所有.
要更新,我在gradle / wrapper / gradle-wrapper.properties中更改了distributionUrl
有人知道解决这个问题吗?我所有的其他分支都很好,我没有做出这种改变.
这里的参考是我的travis.yml,我没有改变任何东西,只是更新了gradle.
language: android
jdk: oraclejdk7
android:
components:
- platform-tools
- tools
- build-tools-23.0.2
- android-23
- sys-img-armeabi-v7a-android-21
- extra-android-support
- extra-android-m2repository
- extra-google-m2repository
- extra-gooogle-google_play_services
env:
global:
- ADB_INSTALL_TIMEOUT=8
- MALLOC_ARENA_MAX=2
sudo: false
cache:
directories:
- $HOME/.gradle/caches/2.8
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper
before_install:
- export ANDROID_HOME=/usr/local/android-sdk
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
- echo "sdk.dir=$ANDROID_HOME" > local.properties
notifications:
slack: caketechnologies:pnmNEHM1ZxudlMZNTv6oVgcT
install:
- TERM=dumb ./gradlew -s assembleDemoDebug
before_script:
# Create and start emulator
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew connectedAndroidTest -PdisablePreDex --stacktrace
解决方法:
这是我的.travis.yml文件.在开始构建之前下载gradle 2.10,因为它还没有在Travis中.
language: android
jdk:
- oraclejdk8
env:
matrix:
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a
global:
- ADB_INSTALL_TIMEOUT=8
android:
components:
- build-tools-23.0.3
- android-23
- add-on
- extra
- sys-img-armeabi-v7a-android-21
before_script:
- wget http://services.gradle.org/distributions/gradle-2.10-bin.zip
- unzip gradle-2.10-bin.zip
- export GRADLE_HOME=$PWD/gradle-2.10
- export PATH=$GRADLE_HOME/bin:$PATH
希望能帮助到你.
标签:android,java,travis-ci 来源: https://codeday.me/bug/20190829/1759656.html