Bug 55635 - System.ArgumentException type provided must be an Enum
Summary: System.ArgumentException type provided must be an Enum
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- major
Target Milestone: 15.3
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-04-26 16:44 UTC by Adam Barlow
Modified: 2017-06-09 08:51 UTC (History)
2 users (show)

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


Attachments
Application project (65.60 KB, application/zip)
2017-04-26 16:47 UTC, Adam Barlow
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 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 NOT_REPRODUCIBLE

Description Adam Barlow 2017-04-26 16:44:29 UTC

    
Comment 1 Adam Barlow 2017-04-26 16:47:40 UTC
Created attachment 21811 [details]
Application project

When I try to build and deploy this project for Android I get a System.ArgumentException
Comment 2 Adam Barlow 2017-04-26 16:50:45 UTC
Whenever I build and deploy my forms application for Android, a System.ArgumentException occurs. However, when I deploy the same project, without changing anything, via Xamarin Studio the error does not occur. It also does not occur for iOS on either XS or VS for mac

DATE: 4/26/2017

EXCEPTION DETAILS:
System.ArgumentException: Type provided must be an Enum.
Parameter name: enumType
  at System.RuntimeType.GetEnumValues () [0x00012] in <d18287e1d683419a8ec3216fd78947b9>:0
  at System.Enum.GetValues (System.Type enumType) [0x00014] in <d18287e1d683419a8ec3216fd78947b9>:0
  at UnitConverter.ConversionPage..ctor () [0x0037f] in /Users/adamb/Projects/UnitConverter/UnitConverter/ConversionPage.cs:64
  at UnitConverter.App..ctor () [0x00008] in /Users/adamb/Projects/UnitConverter/UnitConverter/App.cs:11
  at UnitConverter.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00027] in /Users/adamb/Projects/UnitConverter/Droid/MainActivity.cs:25
  at Android.Support.V4.App.FragmentActivity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <27c17fe440cf491ba8255bcefade6e02>:0
  at at (wrapper dynamic-method) System.Object:c53913b8-9726-4cd1-b497-ab0da23a3a8e (intptr,intptr,intptr)

ENVIRONMENT:
=== Visual Studio for Mac Preview ===

Version Preview - Internal Dogfood (7.0 build 2999)
Installation UUID: aede5e28-2982-4a4c-958a-4a83e7d8d9a8
Runtime:
	Mono 5.0.0.78 (2017-02/ba317ed) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000078

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.0/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.iOS ===

Version: 10.10.0.21 (Visual Studio Enterprise)
Hash: 675645b0
Branch: d15-2
Build date: 2017-04-22 14:32:46-0400

=== Xamarin.Android ===

Version: 7.3.0.11 (Visual Studio Enterprise)
Android SDK: /Users/adamb/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		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: 25.3.1
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.1

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

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

=== Xamarin.Mac ===

Version: 3.4.0.21 (Visual Studio Enterprise)

=== 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: 700002999
Git revision: c143f8927cae083d431e1727c236c44c129738fb
Build date: 2017-04-26 10:30:40-04
Xamarin addins: c3adac6911c458db3617958b76d6f72339dae58e
Build lane: monodevelop-lion-dogfood-vNext

=== Operating System ===

Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 3 Jonathan Pryor 2017-06-01 01:53:40 UTC
@Greg: This sounds like a VS for Mac bug...because it doesn't otherwise make any sense at all. From Comment #2:

> However, when I deploy the same project, without changing anything,
> via Xamarin Studio the error does not occur.

This suggests that ye olde Xamarin Studio is able to build and deploy the project without an error.

> Whenever I build and deploy my forms application for Android,
> a System.ArgumentException occurs
> ...
> ENVIRONMENT:
> === Visual Studio for Mac Preview ===
> 
> Version Preview - Internal Dogfood (7.0 build 2999)

...and these suggest that it happens on Visual Studio for Mac.

Offhand, I can't imagine why this exception could happen in the first place, much less why it would be IDE-dependent. :-/
Comment 4 Greg Munn 2017-06-01 14:31:01 UTC
I can't imagine why either since VS for mac uses the install target to install.
Comment 5 Greg Munn 2017-06-01 14:42:32 UTC
Unless, "Xamarin Studio" is simply a habit and he meant VS for Mac. I opened the project, built and deployed (Debug) and it worked fine for me.


Adam, how were you deploying the project initially?



=== Visual Studio Enterprise 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 583)
Installation UUID: 88baeb16-97ff-4d1d-bba8-3eb382feb879
Runtime:
	Mono 5.2.0.138 (2017-04/f1196da) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000138

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

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

=== Xamarin.Profiler ===

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

=== Xamarin.Android ===

Version: 7.3.0.13 (Visual Studio Enterprise)
Android SDK: /Users/greg/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.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.2.4
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.3

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

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

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: 10.10.0.36 (Visual Studio Enterprise)
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

=== Xamarin.Mac ===

Version: 3.4.0.36 (Visual Studio Enterprise)

=== Build Information ===

Release ID: 701000583
Git revision: 445a7f09feca58babb966e0c66a6b299d0bd450c
Build date: 2017-05-12 16:05:38-04
Xamarin addins: f9b72ca5f6ca5d9476d8f58353ada2afd56c549b
Build lane: monodevelop-lion-d15-3-preview

=== 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

=== Enabled user installed addins ===

Addin Maker 1.3.5
Manifest.addin 0.0.0.0
Comment 6 Adam Barlow 2017-06-02 18:05:43 UTC
Sorry, Xamarin Studio was just habit. I was working within Visual Studio for Mac and I Built and Deployed (Debug).
Comment 7 Greg Munn 2017-06-02 18:33:30 UTC
No problem Adam. How were you deploying outside of Xamarin Studio / Visual Studio for Mac? and can you please provide any applicable logs.
Comment 8 dean.ellis 2017-06-06 09:34:18 UTC
Adam

Any more information on this issue? I just tried the latest Alpha VS for Mac and the sample app works fine without any issues.
Comment 9 dean.ellis 2017-06-08 09:18:57 UTC
Adam

I still cannot replicate this issue. 

Are you able to provide step by step instructions on how to replicate?

I am running with 

Xamarin.Android
Version: 7.3.1.2 (Visual Studio Community)
Comment 10 Adam Barlow 2017-06-08 19:00:45 UTC
Hi Dean,

Sorry, I missed your last comment.

I just tried to reproduce, but I was unable to. I was encountering another issue that required me to delete items in my /Xamarin/Zip/ folder. I'm not sure, but I think this fix also fixed our "System.ArgumentException type provided must be an Enum" issue.

Whatever it was, it's not occurring now. We can close this ticket, if it happens again, I'll record the steps and post it here.

Adam
Comment 11 dean.ellis 2017-06-09 08:51:43 UTC
Hi Adam

Thanks for letting us know. I'll close this for now, please feel free to re-open if it happens again. 

Dean