java - Android Studio - 找不到与包名称“''匹配的客户端
问题描述
我已经导入了模块(多个项目)。导入它们后同步很完美,但是当尝试运行应用程序时,它显示了这个错误 错误
这是我的 build.gradle 文件:
应用插件:'com.android.application' 应用插件:'com.google.gms.google-services'
android { compileSdkVersion 29 buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.secondyr"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
依赖项 { implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.3.1'
implementation 'com.google.firebase:firebase-storage:19.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':SecondYearCivil')
implementation project(path: ':SecondYearCs')
implementation project(path: ':SecondYearElectronics')
implementation project(path: ':SecondYearElectronicsandTelecom')
implementation project(path: ':SecondYearProd')
implementation project(path: ':SecondYearMech')
implementation project(path: ':SecondYearTextile')
implementation project(path: ':SecondYearIT')
implementation project(path: ':SecondYearETC')
}
我在 stackoverflow 上看到过类似的问题,但我理解。我读到了这个解决方案,将 .json 文件中的包名更改为 manisfest 中的包名,我不明白要更改哪一个,因为有很多包名
解决方案
Check your package name on your google-services.json it should be same with your local package name of your app
Something like this
"client_info": {
"mobilesdk_app_id": "1:6596814400689:android:65d6f25f5006145",
"android_client_info": {
"package_name": "com.my.app.package.name"
}
推荐阅读
- php - 如何从数据库中获取价值
- python - 阻止 selenium 在每次启动时创建新的 Firefox 配置文件
- javascript - 登录和注册模式动画不起作用
- php - 我正在尝试让 woocommerce 列出(ul)子类别以显示在主要类别下
- logstash - Logstash 中的日期过滤器因 dateparsefailure 而失败
- android - 代理 gai_error=0 是什么意思?
- llvm - LLVM如何做AOT编译
- java - Java - 在控制台中使用参数启动程序时出错
- ios - 通过从外部点击按钮调用视图动画
- c# - 如何:从 Cosmos DB 获取最新(最新)文档?