Bug 53815 - F# Cannot Create Xamarin class library
Summary: F# Cannot Create Xamarin class library
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: 15.3
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-03-23 00:07 UTC by Rob Lyndon
Modified: 2017-07-02 20:47 UTC (History)
6 users (show)

Tags: Cylce9R
Is this bug a regression?: No
Last known good build:


Attachments
Build Output (19.21 KB, text/plain)
2017-03-27 13:26 UTC, John Miller [MSFT]
Details
Attaching IDE logs (2.84 KB, application/x-zip-compressed)
2017-06-29 12:52 UTC, Aman Dharwal
Details


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 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:
VERIFIED FIXED

Description Rob Lyndon 2017-03-23 00:07:36 UTC
The Xamarin Android class library is completely broken in F#

Start with Visual Studio 2015.

Create a blank solution.

Add a new shared Android project (Visual F# -> Android -> Class Library (Android))

Build the solution. It breaks with the message "AndroidManifest file does not exist".

This is a shared library. I want to use it in my production code, where the AndroidManifest file comes from my Android App projects.
Comment 1 John Miller [MSFT] 2017-03-27 13:26:27 UTC
Created attachment 20885 [details]
Build Output

Added build output showing error: 

1>Target "_ValidateAndroidPackageProperties" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets" from project "c:\users\johmil\documents\visual studio 2017\Projects\Solution1\ClassLibrary1\ClassLibrary1.fsproj" (target "_UpdateAndroidResgen" depends on it):
1>	Task "CreateProperty"
1>	Task "Error"
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(524,2): error : AndroidManifest file does not exist
Comment 2 John Miller [MSFT] 2017-03-27 13:38:32 UTC
## Bookkeeping note

I will prepare a non-engineering team preliminary quick review for this report.


## Suspected to be a regression or a problem with a new feature?
No, and I suspect it is not a regression. Bug #30571 (https://bugzilla.xamarin.com/show_bug.cgi?id=30571) looks like it might be the same issue.


## Specific to one particular project, development computer, or target mobile device?
No. I was able to reproduce this following the steps in the report. Note, this seems to be specific to F# Android Library projects. C# Library projects don't reproduce the same behavior.


## Considers the relevant log files for the part(s) of the process where something goes wrong (IDE editing, MSBuild building, deploying, launching, attaching the debugger, an in-app error, or something else), and has them attached?
I've attached the build output (buildoutput.txt) from my environment once I reproduced the behavior.


## Already took up time for many users?
No. However, it does appear that it would affect any F# Android Library project users.


## Makes development (a) difficult, impossible, or potentially hazardous, (b) moderately inconvenient, or (c) mildly inconvenient for users?

(b)
Comment 3 Rob Lyndon 2017-05-15 12:44:36 UTC
It appears that this been fixed. I have just created an F# library and referenced it (See https://github.com/SpiegelSoft/XamarinForms.Reactive.FSharp). The compiler appears to have no issues.

I will try and do something non-trivial with the project, and mark this issue as resolved if that works. In the meantime, if you believe that the issue is resolved, feel free to mark it as such.

Thanks for the fix.
Comment 4 Rob Lyndon 2017-05-16 11:31:10 UTC
I've created a shared Android project, and it builds correctly, but it does not generate a Resources.designer.fs file. This means that I can't create shared resources to be used in other files.

So although the project builds, it is not much use to me.
Comment 5 Pierce Boggan [MSFT] 2017-06-23 19:46:14 UTC
Thanks so much for taking the time to report this @Rob!

Happy to report this is no longer reproducible in the latest d15-3 builds.

Environment Info: https://gist.github.com/pierceboggan/f1ffd9e92b04565eb494d4138e1a034a
Comment 6 Aman Dharwal 2017-06-29 12:52:29 UTC
Created attachment 23214 [details]
Attaching IDE logs

This issue is not reproducible , hence marking it as Verified

====================================================================

Verified on Environment : 

https://gist.github.com/saurabh-paunikar/f29aeeef08e7ad7c125af1adedd9ff26

===================================================================

Build output logs :

https://gist.github.com/saurabh-paunikar/db1b3fae36e0274e6e1d1dca86c60eba

====================================================================

Screencast link : https://www.screencast.com/t/f92eyefld
Comment 7 Rob Lyndon 2017-07-02 20:42:20 UTC
Hey guys -- may I ask whether Resource.designer.fs is generated in the fixed project? At the moment, when I create a new F# Android app, the file is not generated, and this is a major problem. Has this been fixed as well? If not, I'll create a new issue.
Comment 8 Rob Lyndon 2017-07-02 20:47:44 UTC
Interesting -- the file is there. It's just not included in the project by default. I added it as an existing file, and it is now being generated correctly.