Search code examples
androidandroid-support-libraryandroidxandroid-api-levels

Android studio migrate androidx to android 8.1


Everytime I make a new project, the android studio automatically create a target for api 29, which I dont want to, because I want to use an api 27 and lower. Furthermore, the dependencies its using is "androidx:appcompat" rather than implementation for api 27. Help?

Reason im using api 27 is that im currently making an app for android (oreo) and lower with navigation bar. However, nav bar only works for version of 27.


Solution

  • If you don't want to use androidx, remove everything that has something to do with it in your build.gradle. Also remove

    android.useAndroidX=true
    android.enableJetifier=true
    

    from your gradle.properties or set it to false.

    Then you can import any library you want to the project, with any version and targeted to the API level you want.

    And if you don't want to target API level 29 just go to your build.gradle and set another one in targetSdkVersion. The only bad thing Android Studio will do is give you a hint that you should target the latest version, but you can always turn ir off.