You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

未授予com.google.android.c2dm.permission.SEND权限问题求助

Troubleshooting "com.google.android.c2dm.permission.SEND permission not granted"

Hey there, let's work through this permission issue together—this is a common gotcha when dealing with FCM/C2DM, so here are the key fixes to try:

  • Double-check your permission placement and syntax
    Make sure your <uses-permission> tag is placed outside the <application> tag in your manifest (it looks like you have this right, but it's worth verifying again). Also, confirm there are no typos in the permission name—case sensitivity matters here, and com.google.android.c2dm.permission.SEND is the exact correct string.

  • Understand the permission's protection level
    This is a signature-protected permission, meaning only apps signed with the same certificate as Google Play Services can actually hold it. If you're trying to send C2DM/FCM messages directly from your client app, this approach is outdated and won't work for third-party apps. The modern way to send FCM messages is via Firebase's server-side APIs, not from the client.

  • Verify merged manifest status
    Android Studio merges manifests from your app and its dependencies automatically. Sometimes, the permission might get stripped out during this process. To check:

    1. Navigate to app/build/intermediates/merged_manifests/[your-build-variant]/AndroidManifest.xml
    2. Search for the SEND permission to confirm it's present
      If it's missing, add the tools:node="merge" attribute to your permission tag (don't forget to add the tools namespace to your root manifest tag):
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              package="com.example.lewwe.broadcastsender">
        <uses-permission android:name="com.google.android.c2dm.permission.SEND" tools:node="merge" />
        <!-- rest of your manifest -->
    </manifest>
    
  • Clean and rebuild your project
    Cached build files can sometimes cause manifest changes to not take effect. Try these steps:

    • Click Build > Clean Project
    • Then Build > Rebuild Project
    • If that doesn't work, go to File > Invalidate Caches... > Invalidate and Restart to clear Android Studio's cache entirely.
  • Migrate to modern FCM (if you haven't already)
    C2DM is deprecated, and Firebase Cloud Messaging (FCM) is its replacement. Ensure you're using the latest FCM dependencies in your build.gradle file, like:

    implementation 'com.google.firebase:firebase-messaging:23.4.0' // use the latest version available
    

    Also, make sure your app is properly configured in the Firebase Console (with the correct google-services.json file added to your project).

If you're still stuck, share a bit more context about what you're trying to achieve (e.g., are you trying to send push notifications from the client or server?)—that can help narrow down the issue further.

内容的提问来源于stack exchange,提问作者Lew Wei Hao

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:25:41