Precondition and build config: I am trying to build my app with AndroidStudio 2.4 review 5 by setting below build config paramters for Android O perview device, compileSdkVersion 'android-O' buildToolsVersion '25.0.0' compileOptions.encoding = 'ISO-8859-1' minSdkVersion 16 targetSdkVersion 'O' // Enabling multidex support. multiDexEnabled true
Issue Description: My app uses these below deprecated methods of ConnectivityManager class for devices with older version of android.
-ConnectivityManager.startUsingNetworkFeature()
- ConnectivityManager.stopUsingNetworkFeature()
- ConnectivityManager.requestRouteToHost()
When I try to build my app which has these above api, it is giving compile time error as follows,
Error:(626, 48) error: cannot find symbol method startUsingNetworkFeature(int,String) Error:(7393, 27) error: cannot find symbol method stopUsingNetworkFeature(int,String) Error:(69, 36) error: cannot find symbol method requestRouteToHost(int,int)
Ideally these api should not give compile time error for backward compatibity purpose. Please let me know how to resolve these compile time errors.
I can't remove these methods from code as they are required for devices with older android version(less than Android L version)