0
点赞
收藏
分享

微信扫一扫

Android Studio Bumblebee | 2021.1.1版本引入gradle plugin

紫荆峰 2022-03-15 阅读 180

比如引入 'com.kezong.fat-aar'

之前版本的使用

Module下的build.gradle

apply plugin: 'com.kezong.fat-aar'

工程目录下的build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.github.kezong:fat-aar:1.3.8'
    }
}

--------------------------------------------------------------------------------

Android Studio Bumblebee | 2021.1.1之后的引入方式

Module下的build.gradle

plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id 'com.kezong.fat-aar'
}

 工程目录下的build.gradle如下

buildscript {
    dependencies {
        classpath 'com.github.kezong:fat-aar:1.3.8'
    }
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

主要不同在于

buildscript {
    dependencies {
        classpath 'com.github.kezong:fat-aar:1.3.8'
    }
}

另外记录下代码仓库repositories的配置文件

修改到工程目录下的settings.gradle文件内

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()

        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven {
            url "https://jitpack.io"
        }
        maven {
            url "https://maven.google.com/"
        }
    }
}

举报

相关推荐

0 条评论