TravisCI Android build only works on CI not locally

I have a strange error and I can not 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 this is impossible. This project works locally. There is also a dependency.

Here is 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 

Does anyone have an idea why there is no LayoutInflaterFactory dependency?

https://travis-ci.org/AHarazim/android-mvvm-example

+2
source share
1 answer

Try

 - build-tools-22.0.1 

http://developer.android.com/tools/revisions/build-tools.html

Build Tools, version 22.0.0 (March 2015) Added support for Android 5.1 (API level 22).

And I think this is ed AndroidTest connection.

Update , try to get the latest versions of tools, Travis-ci returned the latest VM update, good luck if this does not work, I do not 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 . I forked your project, tried my suggestions and didn't work. But I continued the discussion on how to add

 retrolambda { jvmArgs '-noverify' } 

As you already did. And there was this option , I did not read it and rushed to the solution and worked :)

 script: - cd MVVM-Example - ./gradlew prepareDebugDependencies - ./gradlew assembleDebug # you can run clean before assemble - ./gradlew app:connectedAndroidTest --info 

I am not familiar with this retrolambda material, please explain the solution for another, if it works for you, I thought it was a simple grass problem.

+2
source

All Articles