Bug 53209 - Firebase Cloud Messaging (Xamarin.Firebase.Messaging 42.1001.0) fails to update AndroidManifest.xml correctly
Summary: Firebase Cloud Messaging (Xamarin.Firebase.Messaging 42.1001.0) fails to upda...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-03-09 22:49 UTC by James Moore
Modified: 2017-03-16 22:39 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 53209 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description James Moore 2017-03-09 22:49:49 UTC
Using Xamarin.Firebase.Messaging 42.1001.0, the build process fails to merge a bunch of XML from the relevant libraries.  If you pull FCM into an Android Studio project, you end up with these xml elements, and I've added some notes about what Xamarin isn't including.

There's some doc about what you need to add by hand, but it's incomplete, and the build process really does have to do this for you.

<?xml version="1.0" encoding="utf-8"?>

        android:name="android.permission.WAKE_LOCK" />

        android:name="com.google.android.c2dm.permission.RECEIVE" />

    <!--Xamarin.Firebase.Iid/library_project_imports/AndroidManifest.xml declares a new permission for your app using -->
    <!-- <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature"/> -->
    <!--however, Xamarin does NOT insert this into the final AndroidManifest.xml file-->
        android:protectionLevel="0x2" />

    <!--and then it uses that permission-->
        android:name="example.com.fcmproject.permission.C2D_MESSAGE" />

        <!--normal Firebase service definition, added by hand by the user-->


                    android:name="com.google.firebase.MESSAGING_EVENT" />

        <!--Added by Android tooling-->
        <!--In Xamarin, added in Xamarin.Firebase.Messaging/library_project_imports/AndroidManifest.xml-->


                    android:name="com.google.firebase.MESSAGING_EVENT" />

        <!--Xamarin build doesn't include this-->
        <!-- https://developer.xamarin.com/guides/android/application_fundamentals/notifications/remote-notifications-with-fcm/#backnotif
        does tell you to add it by hand-->


                    android:name="com.google.android.c2dm.intent.RECEIVE" />

                    android:name="com.google.android.c2dm.intent.REGISTRATION" />

                    android:name="example.com.fcmproject" />

        <!--Xamarin build doesn't include this-->
            android:exported="false" />

        <!--Xamarin build doesn't include this-->


                    android:name="com.google.firebase.INSTANCE_ID_EVENT" />

            android:initOrder="100" />

            android:value="@ref/0x7f0c0003" />

Comment 1 James Moore 2017-03-09 22:50:08 UTC
=== Xamarin Studio Professional ===

Version 6.3 (build 831)
Installation UUID: 6dc077b1-7f04-4c1c-b481-1dcbb9a8b0a1
	Mono 4.8.0 (mono-4.8.0-branch/0494d70) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000516

=== NuGet ===


=== Xamarin.Profiler ===

Version: 1.3.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: (Visual Studio Professional)
Android SDK: /Users/james/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		4.4 (API level 19)
		5.0 (API level 21)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.3.1
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.2

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Android Designer EPL code available here:

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: (Visual Studio Professional)

=== Xamarin Inspector ===

Version: 1.2.0-rc.2
Hash: 15b00be
Branch: d15-1
Build date: Mon, 06 Mar 2017 15:58:04 GMT

=== Xamarin.iOS ===

Version: (Visual Studio Professional)
Hash: 9995504
Branch: master
Build date: 2017-03-03 17:18:51-0500

=== Build Information ===

Release ID: 603000831
Git revision: 7de8ca50bde6552a271e08e88e99a4e0d30cd384
Build date: 2017-02-27 11:27:41-05
Xamarin addins: 959ddb54b5c8f1d757919063b3e9e7feef7028a7
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.3
Darwin MacBook-Pro.restphone.com 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
Comment 2 James Moore 2017-03-09 23:00:12 UTC
I suppose this is related to https://bugzilla.xamarin.com/show_bug.cgi?id=52857 , but if you don't fix 52857 you're going to need to add a bunch of little ad hoc "well, if they're installing this, we better do this other thing by hand."