问题
I'm developing an Android app which will use C2DM to handle push notifications.
Now I'm starting to test it, just the simple steps around registration of the device on C2DM and sending back the registration id to my server, but I'm seeing many warnings about some permissions:
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts
W/PackageManager(59): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
W/PackageManager(59): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x1be45)
W/PackageManager(59): Unknown permission com.google.android.gm.permission.WRITE_GMAIL in package com.android.settings
W/PackageManager(59): Unknown permission com.google.android.gm.permission.READ_GMAIL in package com.android.settings
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development
W/PackageManager(59): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development
W/PackageManager(59): Unknown permission com.google.android.c2dm.permission.RECEIVE in package <my_app_package>
W/ActivityManager(59): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found
I/ActivityManager(59): Displayed activity <my_app_package>/.activities.TabsScreen: 2426 ms (total 2426 ms)
I'm using AVD and haven't configured any Google Account on it yet, but still, it's very odd finding messages regarding not being able to find C2DM permissions, etc.
Any hints about what's happening or what I forgot to add to my project?
回答1:
You need to set up your Manifest with the appropriate permissions as described here: http://code.google.com/android/c2dm/#manifest
回答2:
I had initially configured the SDK to be used in the project to be Google APIs level 8, some way it was reconfigured to use only Android 2.2 SDK API level 8, so it was missing Google's native apps.
来源:https://stackoverflow.com/questions/8854012/unknown-permission-while-developing-with-c2dm