This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 12935 - sensorPortrait should be sensorPortait
Summary: sensorPortrait should be sensorPortait
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings (show other bugs)
Version: 4.6.x
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2013-06-28 04:30 UTC by Dave Wright
Modified: 2015-04-27 06:18 UTC (History)
6 users (show)

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


Attachments
Sample repro (11.08 KB, application/zip)
2014-11-03 15:34 UTC, Jon Douglas
Details

Description Dave Wright 2013-06-28 04:30:14 UTC
In the Activity options, I'm setting ScreenOrientation = ScreenOrientation.SensorPortrait.  However, Google have made a typo (see http://stackoverflow.com/questions/13017922/androidscreenorientation-sensorportrait-not-valid) and it should equate to sensorPortait and not sensorPortrait.

Not sure if this is related to bug 8328 (https://bugzilla.xamarin.com/show_bug.cgi?id=8328) but thought it was dissimilar enough to log a new bug.
Comment 1 Atsushi Eno 2013-06-28 05:44:31 UTC
Wow. OK, I *fixed* it to generate sensorPortait so that apps will build. Thanks for the report.

[master 6bf9591]
Comment 2 Dave Wright 2013-11-15 10:49:18 UTC
Hi there, looks like Google have fixed the problem from API 16.

http://stackoverflow.com/questions/12129558/error-string-types-not-allowed-at-screenorientation-with-value-sensorportai

Sorry for the bother.
Comment 3 John Miller (Xamarin Support) 2014-08-27 17:17:17 UTC
Hitting this with XA 4.16

Targeting API 19. Just add "ScreenOrientation = ScreenOrientation.SensorPortrait" to your activity attributes and build.
Comment 4 John Miller (Xamarin Support) 2014-08-27 17:27:56 UTC
Only compiling against <= API 15 works. Seems there is a typo in this, and depending on the API the attribute is not matching what is expected.
Comment 5 Jonathan Pryor 2014-08-27 17:31:24 UTC
Looks like AndroidManifest.xml generation needs a targetSdkVersion check...
Comment 6 Jon Douglas 2014-11-03 15:34:34 UTC
Created attachment 8607 [details]
Sample repro
Comment 10 Andrei.N 2015-02-24 08:32:06 UTC
The issue now Xamairn build tools create android:portait in the manifest file, even if API level >= 16 which shouldn't be the case
Android has 'portait' only for API level < 15

As a workaround you can set it by code in Activity::OnCreate()
Comment 11 dean.ellis 2015-02-26 15:36:28 UTC
Fixed in monodroid/master/ac63f45a
Comment 12 Andrei.N 2015-04-27 03:26:15 UTC
For which version of Xamarin Android was this marked as fixed?

I have 
Xamarin.Android Version: 4.20.2 and this is not fixed
Comment 13 dean.ellis 2015-04-27 06:18:34 UTC
It should be in the Beta channel at the moment.

Note You need to log in before you can comment on or make changes to this bug.