pom引入okhttp4.x以前的版本idea可以正常编译运行,升级到okhttp4.x后,无法编译运行
因为OkHttp 4.x将我们的实现语言从Java升级到Kotlin,并使其他所有内容保持不变。我们选择Kotlin是因为它在与Java紧密集成的同时为我们提供了强大的新功能。
解决方式:
1、选中菜单的file,选择setting,kotlin update
2、选中菜单的file,选择project structure=>Modules=>选中项目=>点击加号,加上Kotlin
参考文档:
http://www.jetbrains.com/help/idea/kotlin.html
https://blog.csdn.net/wangyuanjiet/article/details/81220987