Android network request framework okhttputils reports an error (okhttp3 cannot be found)

preface

        Okhttputils has always been used in network requests. Recently, gradle was upgraded from 3.2.1 to 4.2.0. The running project reported an error (call could not be found).

         Android studio usage:

                 implementation ‘com.zhy:okhttputils:2.6.2’

Before upgrade

         Android Studio:4.2.0
         Gradle plug-in version: 3.2.1
         Required version of gradle: 4.8.1

After upgrade

         Android Studio:4.2.0
         Gradle plug-in version: 4.2.0
         Required version of gradle: 6.7.1

Operation results

        Error: package okhttp3 does not exist
        import okhttp3.Call;

solve

         New: implementation ‘com. Squareup. Okhttp3: okhttp: 4.9.1’

         I don’t know if there will be problems later. I feel that I still need to change a set of framework. After all, Hongshen has stopped maintenance.

Read More: