从本地jar中添加插件到gradle buildscript [英] add plugin to gradle buildscript from a local jar
本文介绍了从本地jar中添加插件到gradle buildscript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用google-services插件与firebase一起使用,但由于我的一台笔记本电脑上的互联网访问湖,我无法连接到jecenter并添加插件。
I want to aply the google-services plugin to work with firebase , but due to lake of internet access on one of my laptops i can't connect to jecenter and add the plugin .
我已经下载了google-services-3.0.0.jar,但不知道在哪里添加它
以及如何实现
I have downloaded the google-services-3.0.0.jar ,but don't know where to add it and how to implemented
这个项目build.grdle
this the project build.grdle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0' <---i have the jar
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
推荐答案
我能够通过在我的lib文件夹中添加jar来从jar中添加插件,并从项目gradle依赖项中调用它,如下所示:
I was able to add the plugin from the jar by adding the jar in my lib folder and call it from the project gradle dependencies like so :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath fileTree(include: ['*.jar'], dir: 'app/libs')
classpath files('app/libs/google-services-3.0.0.jar')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
这篇关于从本地jar中添加插件到gradle buildscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文