gpt4 book ai didi

android - 在 Cordova 应用程序中使用 cordova-plugin-firebase-analytics 插件在 Android 上出现无效的 google_app_id 错误

转载 作者:太空狗 更新时间:2023-10-29 15:58:47 24 4
gpt4 key购买 nike

我已经设置了一个 Cordova 应用程序来使用 cordova-plugin-firebase-analytics 插件(它使用 cordova-support-google-services 插件)。它适用于 iOS,但不适用于 Android。在 Android 上,事件永远不会被注册。当我使用“adb logcat”输出日志时,出现以下错误:

01-02 13:54:57.322 E/FA (18325): Invalid google_app_id. Firebase Analytics disabled. See https_/goo.gl/NAOOOI. provided id: 1046165292000

注意:我修改了日志中的 url,这样 Stack Overflow 就不会提示 url shorteners。

我已经从 Firebase 控制台添加了 google-services.json 文件,并将 com.google.gms 插件行添加到我的 build.gradle 文件(在 platforms/android 中)。老实说,我不知道接下来要看什么,有什么想法吗?

这是 google-services.json 文件(修改了识别数据)

{
"project_info": {
"project_number": "1000000000000",
"firebase_url": "https://my-app.firebaseio.com",
"project_id": "my-app",
"storage_bucket": "my-app.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1000000000000:android:5da9694e695bed4d",
"android_client_info": {
"package_name": "ca.my.app"
}
},
"oauth_client": [
{
"client_id": "1000000000000-f1l9aikqj3q9fb5bmosdor3acghq60av.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "__mykey__"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

谢谢,杰森

最佳答案

我通过将应用程序 ID 从 Firebase 控制台 (x:xxxxxxxxxxxx:android:xxxxxxxxxxxxx) 复制到 string.xml 文件来修复它,如下所示:

<string name="google_app_id">x:xxxxxxxxxxxx:android:xxxxxxxxxxxxx</string>.

希望对你有帮助

关于android - 在 Cordova 应用程序中使用 cordova-plugin-firebase-analytics 插件在 Android 上出现无效的 google_app_id 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48103840/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com