踩坑日记 :okhttp3 使用报错 java.lang.BootstrapMethodError: Exception from call site #3 bootstrap method

使用:

implementation 'com.squareup.okhttp3:okhttp:3.14.0'

异步请求,报错

 Process: com.example.yangzhan.okhttptest, PID: 23648
    java.lang.BootstrapMethodError: Exception from call site #3 bootstrap method

.....

解决方式:在build.gradle中添加以下代码Java8的新特性

compileOptions{
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

之后

clean project,rebuild project  

 

 


版权声明:本文为qq_32425789原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。