Android Studio - Unresolved reference error

Viewed 668

I am trying to compile an app which still uses the, now deprecated, start/stopUsingNetworkFeature and requestRouteToHost.

To that end, I am following this answer.

However, I am still getting "Unresolved reference" errors for all three methods.

object NetworkFeatureWrapper {
    @Suppress("DEPRECATION")
    fun startUsingNetworkFeature(cm: ConnectivityManager, networkType: Int, feature: String) =
        cm.startUsingNetworkFeature(networkType, feature)
    …
}

I did also set the relevant SDK version in the build.gradle file

android {
    compileSdkVersion 25

    defaultConfig {
        minSdkVersion versions.minSdk // minSdk = 19
        targetSdkVersion 25
        versionCode versions.moduleVersionCode
        versionName versions.moduleVersionName

        compileOptions {
            sourceCompatibility versions.java
            targetCompatibility versions.java
        }
        testInstrumentationRunner libraries.androidJUnitRunner
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation libraries.kotlin
}

I tried downgrading the SDK even further, with no luck.

What am I doing wrong?

It as simple of a lib as possible, if you can even call it that.

0 Answers
Related