Blazej SLEBODA
Blazej SLEBODA

Reputation: 9925

Why a new project templates in Android Studio 3.2.1 does not use the AndroidX libraries?

Google says

"We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well." source

but the Android Studio 3.2.1 still creates a new project templates which are supported by the historical "android.support.*" libraries.

Why?

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.developer.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Upvotes: 4

Views: 835

Answers (1)

TWL
TWL

Reputation: 6646

Not until Android Studio 3.3 or higher (currently still Preview/Beta).

If you create a new project with it, you'll find this Use AndroidX artifacts option. Then once created, you'll find that the dependencies are defaulted with androidx.*

enter image description here

Upvotes: 3

Related Questions