Add in Build.gradle
Join RETROLAMBDA Required Plugin declaration apply plugin: ' Me.tatarka.retrolambda ' //retrolambda the compilation path dependency Buildscript { dependencies { classpath ' me.tatarka:gradle-retrolambda:3.1.0 ' }}//let the IDE use JAVA8 syntax to parse Android { compileoptions { sourcecompatibility javaversion.version_1_8 targetcompatibility JavaVersion.VERSION_1_8 }} Compile rxjavacompile ' io.reactivex:rxjava:1.0.14 '//compile Rxandroidcompile ' io.reactivex:rxandroid:1.0.1 '// Compile retrofit and its associated libraries, including Gsoncompile ' com.squareup.retrofit:retrofit:2.0.0-beta2 ' compile ' com.squareup.retrofit: Converter-gson:2.0.0-beta2 ' compile ' com.squareup.retrofit:adapter-rxjava:2.0.0-beta2 ' compile ' com.google.code.gson:gson:2.4 '
RETROLAMBDA is a syntax feature borrowed from JAVA8 and needs to be configured well JAVA8
Configure the Java8 path in File > Project structure > SDK location after installing JAVA8
Retrofit+rxjava (1)-Configure in Android studio