I've just added the Xamarin.Firebase.Messaging (
<package id="Xamarin.Firebase.Messaging" version="60.1142.1" targetFramework="monoandroid81" />) nuget package to my Xamarin Android app, and now a lot of app users (3000-4000 users) cannot install the app.
The reason is that the FCM library automatically injects the C2D_MESSAGE permission into the generated manifest, with our package name as a prefix. Our package name has uppercase letters, like
Xxx.Yyy.Zzz so the permission in the final manifest becomes:
<permission android:name="Xxx.Yyy.Zzz.permission.C2D_MESSAGE" android:protectionLevel="0x2" /> <uses-permission android:name="Xxx.Yyy.Zzz.permission.C2D_MESSAGE" />
It seems like this is not accepted by some mobile phone brands, as when trying to install the app the user get:
mFinalMessage=Failed parse during installPackageLI: /data/app/vmdl518178908.tmp/base.apk (at Binary XML file line #1 22): Bad class name Xxx.Yyy.Zzz.permission.C2D_MESSAGE in package Xxx.Yyy.Zzz
Same problem is reported in discussion 61727/new-behavior-when-adding-gcm-to-project-it-adds-lines-to-androidmanifest-xml-which-are-wrong for the old GCM package.
This issue also discusses a related feature xamarin/xamarin-android/issues/1335
Does anyone know if there is a solution or workaround to fix this problem?