面料/ Crashlytics在Android上 - 如何使用相同的包名称有两个不同的crashlytics项目? [英] Fabric/Crashlytics on Android - How to have two different crashlytics projects with the same package name?

查看:120
本文介绍了面料/ Crashlytics在Android上 - 如何使用相同的包名称有两个不同的crashlytics项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,并且我想在Crashlytics / Fabric中有两个不同的项目(调试和发布)。



我知道这可以通过两个不同的包名称,但在我的情况下,这两个构建类型的包名称必须相同。



是否有任何可能让两个crashlytics项目具有相同的包名称?

解决方案你好我在几个月前也有同样的问题,我自己解决了。希望我的回答会对你有所帮助。

您需要2个组织,每个组织都有不同的 crashlyticsApiKey

然后在 build.gradle 文件中定义 manifestPlaceHolders
$ debug {
manifestPlaceholders = [crashlyticsApiKey:'your_api_key_for_debug_project_here']
}

release {
manifestPlaceholders = [crashlyticsApiKey:'your_api_key_for_release_project_here']
}

然后你将这个变量放在你的 AndroidManifest.xml 文件中的meta-data上。

 < meta-data 
android:name =io.fabric.ApiKey
android:value =$ {crashlyticsApiKey}/>

就是这样,现在为relase和debug构建您的项目,您将看到您的应用程序将注册为2个不同的结构帐户与相同的软件包nam


I am developing an Android application and I want to have two different projects in Crashlytics / Fabric (debug and release).

I know that this is possible by having two different package names, but in my case, the package name of these two build types have to be the same.

Is there any possibility to have two crashlytics projects with the same package name?

解决方案

Hello I also had same questions months ago and I solved it myself. Hope my answer will help you.

You need 2 organizations with different crashlyticsApiKey for each of your project on fabric.

Then on your build.gradle file you will define manifestPlaceHolders

debug {
        manifestPlaceholders = [crashlyticsApiKey: 'your_api_key_for_debug_project_here']
    }

release {
        manifestPlaceholders = [crashlyticsApiKey: 'your_api_key_for_release_project_here']
    }

Then you will put this variable on meta-data at your AndroidManifest.xml file

<meta-data
        android:name="io.fabric.ApiKey"
        android:value="${crashlyticsApiKey}" />

That's all, now build your project both for relase and debug, you will see your app will registered for 2 different fabric account with same package nam

这篇关于面料/ Crashlytics在Android上 - 如何使用相同的包名称有两个不同的crashlytics项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆