我在添加Firestore依赖项时遇到问题。任何类型的Firestore依赖项都会产生错误,最后发生事件。这里的当前依赖项com.google.firebase:firebase-firestore:17.1.2
添加此依赖项应用程序后,该应用程序未运行,并且我也尝试使用firesrore:16.0.0 and firestore:15:0.1
但这没用。
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.2'
// FireBase
//noinspection GradleCompatible
**implementation 'com.google.firebase:firebase-core:16.0.1'**
/*[This line create Error but i need firestore]*/
implementation 'com.google.firebase:firebase-firestore:17.1.2'
// Audience Network
implementation 'com.android.support:recyclerview-v7:27.1.1'
// Required Dependency by Audience Network SDK
implementation 'com.facebook.android:audience-network-sdk:5.+'
// admob ad dependency
implementation 'com.google.android.gms:play-services-ads:15.0.1'
// Tappx ad Dependency
implementation 'com.tappx.sdk.android:tappx-sdk:3.+'
implementation 'com.google.android.gms:play-services-base:15.0.1'
答案 0 :(得分:1)
查看此链接,可能会有所帮助:
https://firebase.google.com/docs/android/setup
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:4.1.0'
}
dependencies {
implementation 'com.google.firebase:firebase-messaging:17.3.4'
}