Firebase云消息传递不适用于Android上的Build变体

前端之家收集整理的这篇文章主要介绍了Firebase云消息传递不适用于Android上的Build变体前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在Firebase中有2个项目:nl.companyname和nl.companyname.acc:

这是我的build.gradle:

flavorDimensions "type"
productFlavors {
    acceptance {
        dimension="type"
        applicationIdSuffix ".acc"
        versionNameSuffix "-acc"
    }
    production {
        dimension="type"
        applicationIdSuffix ""
        versionNameSuffix ""
    }
}

下载google-services.json在目录中:
应用程序/谷歌-services.json

Android Studio登录Google帐户并已同步:

消息显示为已成功发送:

问题描述:

>在nl.companyname上发送消息时,它可以正常工作.
>发送邮件并定位设备的令牌ID时,它可以正常工作.
>但是nl.companyname.acc不起作用.

试过的步骤:

>我删除了Firebase中的.acc应用程序并重新添加(并下载了新的json文件).

任何帮助是极大的赞赏.

解决方法

Firebase Document中,它支持多种基于味道的项目.

You can have multiple google-services.json files for different build
variants) by placing google-services.json files in dedicated
directories named for each variant under the app module root. For
example,if you have “development” and “release” build flavors,your
configuration could be organized like this:

app/
    google-services.json
    src/development/google-services.json
    src/release/google-services.json
    ...

您可以在here找到完整的说明.

原文链接:https://www.f2er.com/android/317955.html

猜你在找的Android相关文章