Bug 56915 - Xamarin.Facebook.Android fails to correctly generate android:authorities for <provider android:name="com.facebook.internal.FacebookInitProvider"> tag in generated AndroidManifest.xml
Summary: Xamarin.Facebook.Android fails to correctly generate android:authorities for ...
Status: RESOLVED DUPLICATE of bug 51689
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.1 (C9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-05-27 14:30 UTC by Ben Askren
Modified: 2017-06-23 18:38 UTC (History)
3 users (show)

Tags: bb
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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 51689

Description Ben Askren 2017-05-27 14:30:36 UTC
Steps to reproduce:

(1) Using environment w/ VisualStudio Mac (see below for details)
(2) Select "File / New Solution ...".  "New Project" dialog box should appear.
(3) In the left pane, select "Multiplatform / App".
(4) In the middle pane, select "Blank Forms App".
(5) Select [Next] button.  The second "New Project" dialog should appear.
(6) Enter "DroidBuildFail" for "App Name:" and "com.fail" for "Organization Identifier:".
(7) Assure that "Android" "Target Platform" has been selected.
(8) Select "Use Portable Class Library" for "Shared Code:" setting.
(9) Select [Next].  Third "New Project" dialog should appear.
(10) Select [Create].  VisualStudio will create a new project. Wait for packages to be added successfully.
(11) In the Solution Pad, right click on the "DroidBuildFail.Droid" project and select "Set as Startup Project".
(12) In the Solution Pad, expand the "DroidBuildFail.Droid" project and double click on the "Packages" folder.  The "Add Packages" dialog should appear.
(13) Search for and select the "Xamarin.Facebook.Android" package.
(14) Click [Add Package] and wait for the package to be successfully added.
(15) In the Solution Pad, right click on the ".Droid" project and select "Rebuild DroidBuildFail.Droid". 
(16) In the Solution Pad, right click on the  "DroidBuildFail" solution and select "Display Options / Show All Files".
(17) In the Solution Pad, navigate to "DroidBuildFail.Droid/obj/Debug/android" and select the "AndroidManifest.xml" file there.
(18) Inspect lines 34 and 46.  Notice the value of the "android:authorities" attribute is "dollar_openBracket_applicationId_closeBracket".  It should be your app's applicationId ("com.fail.droidbuildfail").

Environment Details:

=== Visual Studio Community 2017 for Mac ===

Version 7.0.1 (build 24)
Installation UUID: c3c61da2-4d87-4c39-b8d3-9fbf7e6af430
Runtime:
	Mono 5.0.1.1 (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.Mac ===

Version: 3.4.0.36 (Visual Studio Community)

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Community)
Android SDK: /Users/ben/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 26.0.2
SDK Platform Tools Version: 25.0.6
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.iOS ===

Version: 10.10.0.36 (Visual Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 700010024
Git revision: 7ab1ca2ced6f584e56b7a0d4d321d00775cd95c9
Build date: 2017-05-19 05:44:51-04
Xamarin addins: 08d17158f3365beee5e60f67999e607cce4b3f93
Build lane: monodevelop-lion-d15-2

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 1 Ben Askren 2017-05-27 14:31:46 UTC
IMPORTANT: I should note that is bug prevents more than one app using Xamarin.Facebook.Android from being installed on the same device.
Comment 2 Ben Askren 2017-05-27 15:27:15 UTC
Upon inspecting the contents of Xamarin.Facebook.Android.dll, there are three AndroidManifest.xml files within the __AndroidLibraryProjects__.zip.  One in the root, on in the bin folder, and on is the aapt folder.  

Of those three AndroidManifest.xml files, two of them (the one in the root and the one in the aapt folder) have 

        <provider
            android:name="com.facebook.internal.FacebookInitProvider"
            android:authorities="dollar_openBracket_applicationId_closeBracket"
            android:exported="false" />

tags while the one in the bin folder is unadultered:

 <provider
            android:name="com.facebook.internal.FacebookInitProvider"
            android:authorities="${applicationId}.FacebookInitProvider"
            android:exported="false" />

So it is possible that the build process is incorrect at both the time this package was made as well as when I build my project with it.
Comment 3 Ben Askren 2017-05-27 15:29:52 UTC
I should note that the above was from Xamarin.Facebook.Android.4.22.0.
Comment 4 Jon Douglas [MSFT] 2017-06-23 15:56:52 UTC
Marking this issue as a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=51689 Please refer to this bug for updates on this issue.

*** This bug has been marked as a duplicate of bug 51689 ***