add plugin to gradle buildscript from a local jar

后端 未结 2 2072
故里飘歌
故里飘歌 2020-12-30 10:59

I\'d like to apply the google-services Gradle plugin to a Java project from a local jar, such that my build does not need to connect to jcenter to download the

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 11:28

    You should create a directory with your *.jar libs and add flatDir {} in repositories {} block to initialize the directory that keeps jar-libs as a repository:

    buildscript {
        repositories {
            jcenter()
            flatDir { dirs 'jarlibs' } // *.jar libs are keep in 'app/jarlibs' dir
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.1.2'
            classpath 'com.google.gms:google-services:3.0.0' // now it works
        }
    }
    

提交回复
热议问题