Article From:https://www.cnblogs.com/ganchuanpu/p/6569111.html

Add in build.gradle

//Plugin declaration required to join the retrolambdaApply plugin:'me.tatarka.retrolambda'Compile path dependency of //retrolambdaBuildsCript {Dependencies {Classpath'me.tatarka:gradle-retrolambda:3.1.0'}}/ / let IDE makeParsing with Java8 syntaxAndroid {CompileOptions {SourceCompatibility JavaVersion.VERSION_1_8TargetCompatibility JavaVersion.VERSION_1_8}}/ / compile RxJavaCompile'io.reactivex:rxjava:1.0.14'/ / compile RxAndroidCompile'io.reactivex:rxandroid:1.0.1'/ / compile Retrofit and its related 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'

RetrolambdaIt is borrowed from the syntax characteristics of Java8 and needs to be configured Java8.
After installing Java8, configure Java8 path in File > Project structure > SDK Location.

Leave a Reply

Your email address will not be published. Required fields are marked *