TravisCI Android编译只对CI失败不在本地 [英] TravisCI Android build fails only on CI not locally
问题描述
我有一个奇怪的错误,不能找到一个解决方案:
I have got a strange error and cannot find a solution:
* What went wrong:
Execution failed for task ':app:compileDebugAndroidTestGroovy'.
> Unable to load class de.rheinfabrik.mvvm_example.activities.DetailsActivity due to missing dependency android/support/v4/view/LayoutInflaterFactory
但无法汇入作业。该项目工程在本地。还依赖是存在的。
But it´s impossible. This project works locally. Also the dependency is there.
下面我.travis.yml
Here my .travis.yml
language: android
jdk: oraclejdk8
env:
matrix:
- ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a
global:
- TERM=dumb
android:
components:
- build-tools-21.1.2
- android-22
- sys-img-armeabi-v7a-android-22
- extra
# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script: cd MVVM-Example && ./gradlew app:connectAndroidTest --stacktrace -PdisablePreDex
任何人都有一个想法,为什么依赖LayoutInflaterFactory丢失?
Anyone have an idea why the dependency LayoutInflaterFactory is missing?
https://travis-ci.org/AHarazim/android-mvvm-example
推荐答案
尝试
- build-tools-22.0.1
http://developer.android.com/tools/revisions/build- tools.html
生成工具,版本22.0.0(2015年3月)增加了对Android的支持
5.1(API等级22)。
Build Tools, Revision 22.0.0 (March 2015) Added support for Android 5.1 (API level 22).
和我认为这是连接的编辑 AndroidTest。
And I think that is connectedAndroidTest.
更新后,试图获得最新版本的工具,特拉维斯慈恢复过去的VM更新,运气好,如果这也不行,我不知道另一种可能的原因:
Update, try to get latest tools versions, Travis-ci reverted the last VM update, good luck, if this doesn't work, I don't know another possible reason:
language: android
android:
components:
- platform-tool
- tool
- android-22
- build-tools-22.0.1
- extra-android-m2repository
- extra-google-m2repository
- sys-img-armeabi-v7a-android-22
UPDATE2 :我分叉项目,尝试我的建议,并没有奏效。但是我遵循的讨论关于增加
Update2: I forked your project, tried my suggestions and it didn't work. But I followed a discussion about to add
retrolambda {
jvmArgs '-noverify'
}
当你已经做了。并有这种变异,我也没有看过,被送往该解决方案及工程)
As you already did. And there was this variant, I didn't read it and rushed to the solution and works :)
script:
- cd MVVM-Example
- ./gradlew prepareDebugDependencies
- ./gradlew assembleDebug # you can run clean before assemble
- ./gradlew app:connectedAndroidTest --info
我不熟悉这个东西retrolambda,请解释其他的解决方案,如果你的作品,我认为这是一个简单的特拉维斯问题。
I'm not familiar with this retrolambda stuff, please explain the solution for other if it works for you, I thought that it was a simple travis issue.
这篇关于TravisCI Android编译只对CI失败不在本地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!