javaandroidkotlinokhttpmms

Why is qksms dependecies from Squareup okhttp causing errors?


This has been answered. But I am banned from posting anymore questions. Please upvote this to unban me. Thanks.

I am total newbie to android studio and java. I am attempting to build an enhanced mms/sms app starting with open source project on github called qksms.

I imported qksms from github which has dependencies from squareup okhttp.

When i run the app... The built output shows the following warnings and errors. the errors are my immediate concern.

WARNINGS: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin. DSL element 'android.viewBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.viewBinding'. :android-smsmms:compileDebugKotlin

ERRORS: android-smsmms/src/main/java/com/android/mms/service_alt/MmsNetworkManager.kt

Unresolved reference: Network

Unresolved reference: wait

Unresolved reference: notifyAll

Unresolved reference: notifyAll

The line that causes the first error is....

class MmsNetworkManager(private val mContext: Context, // The SIM ID which we use to connect private val mSubId: Int) : com.squareup.okhttp.internal.Network {

  1. The App runs on the emmulators even with the errors thrown.
  2. the app wont run on my real device.

Can someone help me resolve the dependency or reference error?

Thanks.


Solution

  • that's a really old version of okhttp 2, I'd suggest updating dependencies to supported versions

    https://square.github.io/okhttp/

    3.12.12 if you need legacy support, or 4.9.0 for reasonably modern devices, Android 5+.