How to fix Expected Android API level 21+ but was 19 in Android

后端 未结 11 1759
甜味超标
甜味超标 2020-12-10 01:06

In my application i want get data from server, for get connect to server i used Retrofit, OkHttp.
But when running application, show me

11条回答
  •  萌比男神i
    2020-12-10 02:03

    Note for @Anupam answer - force is deprecated if you are using Android Studio 4.0+

    https://docs.gradle.org/current/userguide/upgrading_version_5.html

    Forced dependencies Forcing dependency versions using force = true on a first-level dependency has been deprecated.

    Force has both a semantic and ordering issue which can be avoided by using a strict version constraint.

    the way ahead is to use the keyword "strictly" for dependency downgrade. refer to https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html#sec:enforcing_dependency_version

    So you should end up with some thing like the following...

      implementation ('com.squareup.okhttp3:okhttp'){ 
                version {
                    strictly '3.12.12'
                }
        }
    

提交回复
热议问题