cas*_*cal 1 android gradle build.gradle android-gradle-plugin firebase-job-dispatcher
我正在尝试将 Firebase Job Dispatcher 添加到我的项目中,但由于以下错误而无法构建:
Gradle 同步失败:找不到 com.firebase:firebase-jobdispatcher:[版本]。需要者:项目:[模块]
我的build.gradle文件如下所示:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
zipAlignEnabled true
}
}
}
repositories {
mavenCentral()
maven {url "https://clojars.org/repo/"}
}
dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile 'com.firebase:firebase-jobdispatcher:0.5.2'
compile 'com.facebook.stetho:stetho:1.4.2'
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:support-v13:25.3.0'
compile 'com.google.code.gson:gson:2.7'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/volley.jar')
}
Run Code Online (Sandbox Code Playgroud)
此外,我还通过 SDK 管理器安装了版本 45 的 Google 存储库和版本 39 的 Google Play 服务。
根据firebase-jobdispatcher Github 页面上的文档,这应该是我唯一需要添加依赖项的东西。我的项目不依赖 GCM,所以我不确定发生了什么。我在这里缺少什么吗?
显然,Gradle 无法单独使用 Maven Central 解决依赖关系。将 JCenter 添加到我的存储库列表中解决了该问题:
repositories {
jcenter() // new
mavenCentral()
maven {url "https://clojars.org/repo/"}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3796 次 |
| 最近记录: |