Android – Warning:Conflict with dependency ‘’ solution

When I tried to add these library dependencies:

    compile 'com.trello:rxlifecycle:0.7.0'
    compile 'com.trello:rxlifecycle-android:0.7.0'

I received following error:

Warning:Conflict with dependency ‘’. Resolved versions for app (3.0.1) and test app (2.0.1) differ. See for details.
Error:Execution failed for task ‘:app:prepareDebugAndroidTestDependencies’.
> Dependency Error. See console for details.
Information:BUILD FAILED

Then I googled and found this solution:
In your apps build.gradle add the following within android { }:

configurations.all {
    resolutionStrategy.force ''

How to use lambda in Android Studio?

First of all, add following to build.gradle(app) file:

android {
    defaultConfig {
        jackOptions {
            enabled true
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

After that you can use lambda in your application:

        Button button = (Button) findViewById(;
        button.setOnClickListener(v-> Toast.makeText(getApplicationContext(), "Hello Lambda", Toast.LENGTH_LONG).show());

instead of this:

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(getApplicationContext(), "Hello Lambda", Toast.LENGTH_LONG).show();