Bug 23564 - Setting WindowSoftInputMode to SoftInput.AdjustNothing on Activity generates an out of range exception on compilation.
Summary: Setting WindowSoftInputMode to SoftInput.AdjustNothing on Activity generates ...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.18.0
Hardware: PC Windows
: --- normal
Target Milestone: 5.1
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2014-10-03 01:23 UTC by Matthew Robbins
Modified: 2015-03-12 17:52 UTC (History)
3 users (show)

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

Description Matthew Robbins 2014-10-03 01:23:42 UTC
Steps to reproduce:

1- Create a new Android project using the default template.
2- In the MainActivity [Activity] attribute, add WindowSoftInputMode=SoftInput.AdjustNothing.

EG:
[Activity (Label = "AdjustNothingException", MainLauncher = true, Icon = "@drawable/icon",WindowSoftInputMode=SoftInput.AdjustNothing)]

3- Compile application.

Below is the exception that appears for me:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error MSB4018: The "GenerateJavaStubs" task failed unexpectedly.
System.ArgumentException: Unsupported WindowSoftInputMode adjust value: AdjustNothing.
Parameter name: value
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.ToString(SoftInput value)
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.<ValueConverters>m__9(Object value, ICustomAttributeProvider p, IAssemblyResolver r)
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.ToAttributeValue(String name, T value, ICustomAttributeProvider provider, IAssemblyResolver resolver)
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.ToAttribute(String name, T value, String packageName, ICustomAttributeProvider provider, IAssemblyResolver resolver)
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.<ToElement>c__AnonStorey0.<>m__0(String e)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content)
   at Xamarin.Android.Manifest.ManifestDocumentElement`1.ToElement(T value, ICollection`1 specified, String packageName, ICustomAttributeProvider provider, IAssemblyResolver resolver)
   at Android.App.ActivityAttribute.ToElement(IAssemblyResolver resolver, String packageName)
   at Xamarin.Android.Tasks.ManifestDocument.<ActivityFromTypeDefinition>m__F(ActivityAttribute aa)
   at Xamarin.Android.Tasks.ManifestDocument.ToElement[TAttribute](TypeDefinition type, String name, Func`2 parser, Func`2 toElement, Action`2 update)
   at Xamarin.Android.Tasks.ManifestDocument.ActivityFromTypeDefinition(TypeDefinition type, String name)
   at Xamarin.Android.Tasks.ManifestDocument.Merge(List`1 subclasses, List`1 selectedWhitelistAssemblies, Boolean embed, Boolean replaceSplashScreen, IDictionary`2 splashScreenClasses, String bundledWearApplicationName)
   at Xamarin.Android.Tasks.GenerateJavaStubs.Run()
   at Xamarin.Android.Tasks.GenerateJavaStubs.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (AdjustNothingException)
Comment 1 Atsushi Eno 2014-10-03 02:39:12 UTC
Thanks for the report. We fixed the issue in XA. The fix will be available in 4.20 (or any equivalent new release).

[master a212364]
Comment 2 Ram Chandra 2014-11-26 06:32:16 UTC
I have checked this issue and I am able to reproduce this issue with following builds:

Windows 8.1
VS 2013
XVS: 3.7.248.0

Screencast: http://www.screencast.com/t/8hhgcN5RL

With the help of following builds, I am able to verify that this issue has been fixed.

Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.53344
Installed Version: Professional
Xamarin   3.9.28.0 (f06bad7)
Xamarin.Android   5.0.0.0 (d507ba60cc907073c9b40ebc88bab6311b748c20)
Xamarin.iOS   8.6.0.0 (8dc6ec80fb6f7c1ec874ad67ffca859cdad94282)

When I set the "WindowSoftInputMode=SoftInput.AdjustNothing" attribute on activity, I observed that I am not getting any error/exception. I am able to build and deploy android application successfully.

Screencast: http://www.screencast.com/t/jkI1HvFd18Hb

This issue has been fixed. Hence, I am closing this issue.