从Google Services 9.0.0中排除Firebase

时间:2022-03-16 15:18:37

I'm trying to get rid of Firebase because it's apparently included in latest Google Services. I'm using Analytics so I added this dependency to my build.gradle

我正试图摆脱Firebase,因为它显然包含在最新的Google服务中。我正在使用Google Analytics,因此我将此依赖项添加到了build.gradle中

compile 'com.google.android.gms:play-services-analytics:9.0.0'

When I tried to update my app at Google Play I noticed two new (GCM) permissions

当我尝试在Google Play上更新我的应用时,我发现了两个新的(GCM)权限

com.google.android.c2dm.permission.RECEIVE
org.indywidualni.somepackage.permission.C2D_MESSAGE

I discovered they are added by new Services automatically because of Firebase. I don't use Firebase so I decided just to exclude it from project. How can I do it?

我发现由于Firebase,它们会被新服务自动添加。我没有使用Firebase,因此我决定将其从项目中排除。我该怎么做?

2 个解决方案

#1


3  

Include this lines in your app manifest file:

在您的应用清单文件中包含以下行:

  <uses-permission
 android:name="com.google.android.c2dm.permission.RECEIVE"
 tools:node="remove" /> 
  <uses-permission
 android:name="com.somepackage.permission.C2D_MESSAGE"
 tools:node="remove" />

To remove unwanted firebase classes include this in your gradle file:

要删除不需要的firebase类,请在gradle文件中包含以下内容:

 configurations {
     all*.exclude group: 'com.google.firebase', module: 'firebase-common'
     all*.exclude group: 'com.google.firebase', module: 'firebase-core'
     all*.exclude group: 'com.google.firebase', module: 'firebase-iid' }

#2


2  

The Firebase team is currently recommending that you do not try to force Firebase permissions out of an app built with Firebase (although the Android tools make this possible). Those extra permissions should not be causing problems. There is current discussion on this on the firebase-talk group.

Firebase团队目前建议您不要试图强制使用Firebase构建的应用程序使用Firebase权限(尽管Android工具可以实现这一点)。这些额外的权限不应该导致问题。目前有关firebase-talk小组的讨论。

If you have a very specific problem with these permissions (other than the fact that they exist), that's something we do need to know about, and you could file a bug report about that here.

如果你对这些权限有一个非常具体的问题(除了它们存在的事实),这是我们需要知道的事情,你可以在这里提交一份关于它的错误报告。

#1


3  

Include this lines in your app manifest file:

在您的应用清单文件中包含以下行:

  <uses-permission
 android:name="com.google.android.c2dm.permission.RECEIVE"
 tools:node="remove" /> 
  <uses-permission
 android:name="com.somepackage.permission.C2D_MESSAGE"
 tools:node="remove" />

To remove unwanted firebase classes include this in your gradle file:

要删除不需要的firebase类,请在gradle文件中包含以下内容:

 configurations {
     all*.exclude group: 'com.google.firebase', module: 'firebase-common'
     all*.exclude group: 'com.google.firebase', module: 'firebase-core'
     all*.exclude group: 'com.google.firebase', module: 'firebase-iid' }

#2


2  

The Firebase team is currently recommending that you do not try to force Firebase permissions out of an app built with Firebase (although the Android tools make this possible). Those extra permissions should not be causing problems. There is current discussion on this on the firebase-talk group.

Firebase团队目前建议您不要试图强制使用Firebase构建的应用程序使用Firebase权限(尽管Android工具可以实现这一点)。这些额外的权限不应该导致问题。目前有关firebase-talk小组的讨论。

If you have a very specific problem with these permissions (other than the fact that they exist), that's something we do need to know about, and you could file a bug report about that here.

如果你对这些权限有一个非常具体的问题(除了它们存在的事实),这是我们需要知道的事情,你可以在这里提交一份关于它的错误报告。