android - Firebase 无法连接到我的 android 应用程序
问题描述
当我在模拟器或真实设备上安装我的应用程序时,我正在尝试在我的 android 应用程序上设置 firebase,firebase 无法识别我的安装并坚持安装 firebase 的第四步(运行您的应用程序以验证安装)我跳过那个但在安装号或通知接收器计数不会显示我的应用程序。有趣的是我在一个测试项目中实现了它并且它工作。
这是我的毕业典礼
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "netherland.com.app.vanlaartsoapp"
minSdkVersion 17
targetSdkVersion 29
versionCode 10
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-alpha08'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.karumi:dexter:5.0.0'
implementation 'androidx.room:room-runtime:2.2.0-alpha01'
annotationProcessor "androidx.room:room-compiler:2.2.0-alpha01"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
}
应用插件:'com.google.gms.google-services'
解决方案
确保将 google.json 文件添加到您的项目中
推荐阅读
- python - 试图理解 __init__.py 结合 getattr
- javascript - 网络视频播放率
- java - 从 Mono 返回 Java 对象
- python - 尝试创建包含所有食材的晚餐菜单
- python - 如何在我的第一个 python 计算器中修复这个 while 循环?
- amazon-web-services - Greengrass 部署失败,因为核心版本“1.10.2”低于最低要求版本:“1.11.0”,但“1.11.0”甚至还不存在?
- swiftui - SwiftUI:如何根据当前场景显示新视图
- docker - 使用 JDBC 输入插件在 Docker 上的 Logstash 不会从 SQL Server 获取所有行
- flutter - 如何突出显示我在字符串中搜索的确切单词,而不仅仅是字符串的开头?
- flutter - 如何实时获取文档长度