Android项目中的默认外部库来自哪里?

问题描述 投票:1回答:1

如果我使用Android Studio创建新的Android项目并默认删除所有依赖项,如下所示:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.example.dependencies"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
    kotlinOptions { jvmTarget = "1.8" }
}
// I remove all dependencies
dependencies {
}

如果检查Project -> External libraries中的外部库,则为结果。enter image description here

问题

我正在阅读gradle documentation,这种情况令人困惑。上图的外部库来自哪里?

android android-gradle-plugin dependency-management
1个回答
0
投票

上面图片的外部库来自哪里?

它们来自您的插件,特别是这两个:

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

如果您将其注释掉,则除了Android平台JAR之外,您应该没有其他依赖项。

© www.soinside.com 2019 - 2024. All rights reserved.