Ahm*_* na 8 java android gradle
我想使用google-services插件与Firebase配合使用,但是由于其中一台笔记本电脑无法上网,我无法连接到jecenter并添加该插件。
我已经下载了google-services-3.0.0.jar,但不知道在哪里添加它以及如何实现
这个项目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
}
}
Run Code Online (Sandbox Code Playgroud)
我可以通过将jar添加到我的lib文件夹中,然后从项目gradle依赖项中调用它来从jar添加插件:
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
}
}
Run Code Online (Sandbox Code Playgroud)
您应该创建您的目录*.jar库和添加flatDir {}的repositories {}模块初始化,保持JAR-库的储存库的目录:
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
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5011 次 |
| 最近记录: |