Bug 8369 - BindingsGenerator couldn't not handle ApiXmlInput containing empty spaces.
Summary: BindingsGenerator couldn't not handle ApiXmlInput containing empty spaces.
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.2.x
Hardware: PC Windows
: Highest normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-11-13 09:43 UTC by Andreas
Modified: 2013-07-12 03:01 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:
RESOLVED FIXED

Description Andreas 2012-11-13 09:43:06 UTC
Leading to exception:

System.InvalidOperationException was unhandled
  Message=Only one .xml file may be specified.
  Source=generator
  StackTrace:
       at Xamarin.Android.Binder.CodeGeneratorOptions.Parse(String[] args)
       at Xamarin.Android.Binder.CodeGenerator.Main(String[] args)
  InnerException: 


Workaround - add " to line 202 of Xamarin.Android.Bindings.targets.

      ApiXmlInput=""$(ApiOutputFile)""

But should be better fixed inside of the BindingsGenerator task.

Please let me know if you need more information.

Thanks in advance for your support.

Br,

Andreas
Comment 2 Andreas 2013-05-21 06:24:57 UTC
Still the same with v4.6.6 :-(
Comment 3 Atsushi Eno 2013-05-30 03:21:39 UTC
I reviewed the code and fixed all possible issues that could cause this in our MSBuild tasks. Thanks for the report!

[master 5126657]
Comment 4 Andreas 2013-07-11 03:42:49 UTC
And still the same with v4.6.8 :-(
Only the line number the workaround has to be applied has changed - now it's line 278 - if anyone else encounter this problem this might help.
Comment 5 Atsushi Eno 2013-07-11 05:24:56 UTC
Could you provide an example project that can reproduce the issue?
Comment 6 Andreas 2013-07-11 06:24:10 UTC
Well - a sample project wouldn't be sufficient to show the error. You really need a path with empty spaces defined as the output path. I've attached a detailed msbuild log - so I hope you get the idea. Please let me know if I could contribute in any other way.

  <project dir="c:\project.net\Soloplan\Mobile\Alk" name="Soloplan.Mobile.Alk.M4A.csproj">
    <error code="MSB6006" message="&quot;generator.exe&quot; exited with code 255." dir="C:\Program Files (x86)\MSBuild\Xamarin\Android" name="Xamarin.Android.Bindings.targets" pos="(273, 5)" />
    <message importance="Normal">Deleting file "C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\api.xml".</message>
    <message importance="Normal">  RemovedDirectories: </message>
    <message importance="Normal">    C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\generated\</message>
    <message importance="Normal">  RemovedDirectories: </message>
    <message importance="Normal">    C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\library_project_imports</message>
    <message importance="Normal">Skipping target "ResolveLibraryProjects" because it has no inputs.</message>
    <message importance="Normal">MonoAndroid Tools: C:\Program Files (x86)\MSBuild\Xamarin\Android\</message>
    <message importance="Normal">MonoAndroid Framework: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.0\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\</message>
    <message importance="Normal">Android SDK: C:\Program Files (x86)\Android\android-sdk\</message>
    <message importance="Normal">Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_25\</message>
    <message importance="Normal">  Assemblies: </message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.0\Mono.Android.dll</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll</message>
    <message importance="Normal">  Jars: </message>
    <message importance="Normal">  ResolvedResourceDirectories: </message>
    <message importance="Normal">  SourceJars:</message>
    <message importance="Normal">    Jars\alkwrapper.jar</message>
    <message importance="Normal">  ReferenceJars:</message>
    <message importance="High">C:\Program Files (x86)\Java\jdk1.7.0_25\bin\java.exe -jar "C:\Program Files (x86)\MSBuild\Xamarin\Android\jar2xml.jar" --jar=c:\project.net\Soloplan\Mobile\Alk\Jars\alkwrapper.jar --ref="C:\Program Files (x86)\Android\android-sdk\platforms\android-14\android.jar" --out="C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\api.xml" </message>
    <message importance="Normal">  RemovedDirectories: </message>
    <message importance="Normal">    C:\Users\build\AppData\Local\Temp\bx0e43xc.rjs</message>
    <message importance="Normal">  TransformFiles:</message>
    <message importance="Normal">    Transforms\Metadata.xml</message>
    <message importance="Normal">    Transforms\EnumFields.xml</message>
    <message importance="Normal">    Transforms\EnumMethods.xml</message>
    <message importance="Normal">  ReferencedManagedLibraries:</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.0\Mono.Android.dll</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll</message>
    <message importance="Normal">    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll</message>
    <message importance="Normal">Adding transform file Transforms\Metadata.xml as metadata.</message>
    <message importance="Normal">Adding transform file Transforms\EnumFields.xml as enumfields.</message>
    <message importance="Normal">Adding transform file Transforms\EnumMethods.xml as enummethods.</message>
    <message importance="High">C:\Program Files (x86)\MSBuild\Xamarin\Android\generator.exe C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\api.xml --csdir="C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\generated\src" --enumdir="C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\generated\enums" --enummetadata="C:\CruiseControl.NET\server\Continuous Integration Build\WorkingDirectory\Temp\generated\metadata" --assembly=Soloplan.Mobile.Alk.M4A --ref="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" --ref="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.0\Mono.Android.dll" --ref="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" --ref="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" --ref="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" --fixup=Transforms\Metadata.xml --enumfields=Transforms\EnumFields.xml --enummethods=Transforms\EnumMethods.xml --api-level=14 --global --public </message>
    <message importance="Normal" />
    <message importance="Normal">Unhandled Exception: System.InvalidOperationException: Only one .xml file may be specified.</message>
    <message importance="Normal">   at Xamarin.Android.Binder.CodeGeneratorOptions.Parse(String[] args)</message>
    <message importance="Normal">   at Xamarin.Android.Binder.CodeGenerator.Main(String[] args)</message>
  </project>
Comment 7 Atsushi Eno 2013-07-12 02:59:53 UTC
I noticed what is wrong. 4.6.8 is too old to get the fix. The latest 4.7.x is the only available build that contains the fix.
Comment 8 Atsushi Eno 2013-07-12 03:01:13 UTC
BTW a reproducible project should be like, containing subdirectories that contain a whitespace in the name. That is how I reproduced and verified the fix.