Android Study

AndroidStudio(BumbleBee)에서 프로젝트 생성후, project level build.grale 추가시 dependencies 추가 방법

85chong 2022. 4. 28. 15:49
728x90
반응형
SMALL

* 이전에 생성되는 기본 project > build.gradle

buildscript {
    ext.kotlin_version = "1.4.10"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

subprojects {
    repositories {
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

 

 


*  Android BunbleBee 이후 부터는 project > build.gradle 이 아래와 같이 생성된다.

plugins {
    id 'com.android.application' version '7.1.1' apply false
    id 'com.android.library' version '7.1.1' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}





* 이때 buildscript dependencies 를 추가하려면 plugins 위에 추가해주면된다.

buildscript {
  dependencies {
      classpath 'com.google.gms:google-services:4.3.10'
   }
}
 plugins {
      id 'com.android.application' version '7.1.0' apply false
      id 'com.android.library' version '7.1.0' apply false
}

task clean(type: Delete) {
   delete rootProject.buildDir
}



- 끝 -