Bug 54663 - When building an binding libary on Windows with a non '.' digital separator you get errors
Summary: When building an binding libary on Windows with a non '.' digital separator y...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 7.2 (15.1)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2017-04-06 19:16 UTC by thomas
Modified: 2017-06-28 21:55 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 FIXED

Description thomas 2017-04-06 19:16:36 UTC
When trying to build this binding project: https://github.com/martijn00/ExoPlayerXamarin

I got this errors:

1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Text.Cue.cs(27,45,27,55): error CS1001: Identifier expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Text.Cue.cs(27,45,27,55): error CS0145: A const field requires a value to be provided
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Text.Cue.cs(27,45,27,55): error CS1003: Syntax error, ',' expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Trackselection.AdaptiveVideoTrackSelection.cs(15,59,15,61): error CS1001: Identifier expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Trackselection.AdaptiveVideoTrackSelection.cs(15,59,15,61): error CS0145: A const field requires a value to be provided
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.Trackselection.AdaptiveVideoTrackSelection.cs(15,59,15,61): error CS1003: Syntax error, ',' expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(15,63,15,65): error CS1001: Identifier expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(15,63,15,65): error CS0145: A const field requires a value to be provided
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(15,63,15,65): error CS1003: Syntax error, ',' expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(19,58,19,62): error CS1001: Identifier expected
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(19,58,19,62): error CS0145: A const field requires a value to be provided
1>C:\Entwicklung\OSS\ExoPlayerXamarin\ExoPlayer\obj\Debug\generated\src\Com.Google.Android.Exoplayer2.UI.SubtitleView.cs(19,58,19,62): error CS1003: Syntax error, ',' expected


Looking further turned out that the Bindings generator used the currenty set culture to convert float values to strings:


// Metadata.xml XPath field reference: path="/api/package[@name='com.google.android.exoplayer2.text']/class[@name='Cue']/field[@name='DIMEN_UNSET']"
[Register ("DIMEN_UNSET")]
public const float DimenUnset = (float) 1,401298E-45;


WHich IMHO is a bug it should not care about the system culture setting at all.
When I change the decimal separator to '.' it compiled, but for any country that uses an other sign this is not ok.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-04-06 21:56:03 UTC
## Note to the Xamarin team

I suspect this might be now fixed in the master development branch by https://github.com/xamarin/java.interop/pull/131
Comment 2 Jimmy [MSFT] 2017-06-28 21:55:49 UTC
As Brendan mentioned, this issue appears to have been fixed and I was able to successfully build the ExoPlayer project in Visual Studio using Xamarin.Android 7.3.1.2. 

If you continue to experience this issue with Xamarin.Android 7.3.1.2 or higher, please reopen this bug so we can investigate further. Thanks!