找不到com.google.firebase:firebase-core:9.0.0? [英] Could not find com.google.firebase:firebase-core:9.0.0?
问题描述
在我的应用程序中,我尝试使用gcm服务,但我甚至无法编译gradle。我不断收到我缺少'firebase core'的消息,但我不知道如何安装它。
这是我的顶级gradle文件:
buildscript {
repositories {
jcenter()
}
依赖关系{
classpath'com.android.tools.build:gradle:2.1.2'
classpathio.realm:realm-gradle-plugin:1.1.0
classpath'com.neenbedankt .gradle.plugins:android-apt:1.8'
classpath'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
urlhttps://jitpack.io
}
maven {
urlhttps://mint.splunk.com/gradle/
}
}
}
这里是我的模块级gradle文件:
apply plugin:' com.android.application'
apply plugin:'realm-android'
apply plugin:'com.google.gms.google-s ervices'
android {
compileSdkVersion 24
buildToolsVersion24.0.0
defaultConfig {
applicationIdroof。 android
minSdkVersion 17
targetSdkVersion 23
versionCode 11
versionName0.0.4
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
packagingOptions {
'META- INF / NOTIC E.txt'
排除'META-INF / LICENSE.txt'
排除'META-INF / maven / com.fasterxml.jackson.core / jackson-core / pom.properties'
排除'META-INF / maven / com.fasterxml.jackson.core / jackson-core / pom.xml'
}
}
依赖关系{
编译fileTree(包括:['* .jar'],dir:'libs')
//Android支持库包包含几个可包含在应用程序中的库 - https ://发展er.android.com/topic/libraries/support-library/features.html
编译'com.android.support:appcompat-v7:24.0.0'
//Native android回收站视图库 - https://developer.android.com/topic/libraries/support-library/features.html
编译'com.android.support:recyclerview-v7:24.0.0'
//Android强大的图片下载和缓存库 - http://square.github.io/picasso/
编译'com.squareup.picasso:picasso:2.5.2'
//Volley是一个HTTP库,它使得Android应用程序的联网更容易,更重要,速度更快 - https://developer.android.com/training/volley/index.html
compile'com.android.volley:volley:1.0.0'
//Auth0中的JsonWebTokens - https://auth0.com/docs/jwt
编译' com.auth0:java-jwt:2.1.0'
//Joda-Time为Java日期和时间类提供了高质量的替代品 - http://www.joda.org/ joda-time /
编译'joda-time:joda-time:2.8.1'
//Android加载或进度对话框小部件库,提供有效的方式来实现像加载对话框和进度轮的iOS - https://github.com/Cloudist/ACProgressLite
编译'cc.cloudist .acplibrary:library:1.2.1'
//一个由Realm支持的RecyclerView以及更多内容 - https://github.com/thorbenprimke/realm-recyclerview
编译'com.github.thorbenprimke:realm-recyclerview:0.9.22'
//为你的应用程序提供一个美丽的涟漪动画 - https://github.com/skyfishjy/android-ripple -background
compile'com.skyfishjy.ripplebackground:library:1.0.1'
//一个具有小型可扩展API的记录器,它在Android的普通Log类之上提供实用工具。 - http://jakewharton.github.io/timber/
compile'com.jakewharton.timber:timber:4.1.2'
//Android视图的字段和方法绑定 - http://jakewharton.github.io/butterknife/
编译'com.jakewharton:butterknife:8.1.0'
apt'com.jakewharton:butterknife-compiler:8.1.0'
//用于Android和Java应用程序的HTTP + HTTP / 2客户端。 - http://square.github.io/okhttp/
编译'com.squareup.okhttp3:okhttp:3.3.1'
//用于Sentry的Android客户端
compile'com.joshdholtz.sentry:sentry-android:1.4.1'
compile'com.google.android.gms:play-services-gcm:9.2.0'
-
在您的模块Gradle文件(通常是
app / build.gradle
)中,添加apply插件(apply plugin:'com.google .gms.google-services'
)在文件底部启用Gradle插件。 你还应该添加Firebase
com.google.firebase:firebase-core
和 com.google.firebase:firebase-messaging
的依存关系SDK's: apply plugin:'com.android.application'
android {
// ...
}
依赖关系{
// ...
编译'com.google.firebase:firebase-core:10.2.1'
编译'com .google.firebase:firebase-messaging:10.2.1'
}
//将此添加到底部
apply插件:'com.google.gms.google-services '
确保您拥有最新版本的在使用 Firebase 时安装的'Google Play服务'和'Google Repository'。
请按照以下步骤进行安装:
- 打开Android Studio >
- 转到菜单栏>工具> Android> SDK管理器
- 点击Tab> SDK Tools
- 安装'Google Play服务'和'Google资源库'
- 点击应用并等待下载
最后,再次同步和建立您的项目。
In my app, I am trying to use gcm services, but I cannot even get gradle to compile. I keep getting the message that I am missing 'firebase core' though I have no idea how to install this.
This is my top-level gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath "io.realm:realm-gradle-plugin:1.1.0"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
}
And here is my module-level gradle file:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "roof.android"
minSdkVersion 17
targetSdkVersion 23
versionCode 11
versionName "0.0.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/NOTIC E.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.properties'
exclude 'META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.xml'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// "The Android Support Library package contains several libraries that can be included in your application" -- https://developer.android.com/topic/libraries/support-library/features.html
compile 'com.android.support:appcompat-v7:24.0.0'
// "Native android recycler view library" -- https://developer.android.com/topic/libraries/support-library/features.html
compile 'com.android.support:recyclerview-v7:24.0.0'
// "A powerful image downloading and caching library for Android" -- http://square.github.io/picasso/
compile 'com.squareup.picasso:picasso:2.5.2'
// "Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster" -- https://developer.android.com/training/volley/index.html
compile 'com.android.volley:volley:1.0.0'
// "JsonWebTokens in Auth0" -- https://auth0.com/docs/jwt
compile 'com.auth0:java-jwt:2.1.0'
// "Joda-Time provides a quality replacement for the Java date and time classes" -- http://www.joda.org/joda-time/
compile 'joda-time:joda-time:2.8.1'
// "Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel" -- https://github.com/Cloudist/ACProgressLite
compile 'cc.cloudist.acplibrary:library:1.2.1'
// "A RecyclerView that is powered by Realm and lots more" -- https://github.com/thorbenprimke/realm-recyclerview
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.22'
// "A beautiful ripple animation for your app" -- https://github.com/skyfishjy/android-ripple-background
compile 'com.skyfishjy.ripplebackground:library:1.0.1'
// "A logger with a small, extensible API which provides utility on top of Android's normal Log class." -- http://jakewharton.github.io/timber/
compile 'com.jakewharton.timber:timber:4.1.2'
// "Field and method binding for Android views" -- http://jakewharton.github.io/butterknife/
compile 'com.jakewharton:butterknife:8.1.0'
apt 'com.jakewharton:butterknife-compiler:8.1.0'
// "An HTTP+HTTP/2 client for Android and Java applications." -- http://square.github.io/okhttp/
compile 'com.squareup.okhttp3:okhttp:3.3.1'
// "Android client for Sentry"
compile 'com.joshdholtz.sentry:sentry-android:1.4.1'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
}
In your module Gradle file (usually the
app/build.gradle
), add the apply plugin(apply plugin: 'com.google.gms.google-services'
) line at the bottom of the file to enable the Gradle plugin.You should also add the dependencies for the Firebase
com.google.firebase:firebase-core
andcom.google.firebase:firebase-messaging
SDK's:apply plugin: 'com.android.application' android { // ... } dependencies { // ... compile 'com.google.firebase:firebase-core:10.2.1' compile 'com.google.firebase:firebase-messaging:10.2.1' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'
Make sure you have the latest version of 'Google Play services' and 'Google Repository' installed while using Firebase.
Please follow below steps to install:
- Open Android studio
- Go to the Menu bar > Tools > Android > SDK Manager
- Click on Tab > SDK Tools
- Check and install 'Google Play Services' and 'Google Repository'
- Click on Apply and wait for the download
Finally, Sync and build your project again.
这篇关于找不到com.google.firebase:firebase-core:9.0.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!