Bug 14363 - "java.exe" exited with code 1 when Binding Parse Java SDK to Xamarin.Android
Summary: "java.exe" exited with code 1 when Binding Parse Java SDK to Xamarin.Android
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2013-08-31 13:00 UTC by Dv.Mohamed
Modified: 2015-03-26 05:50 UTC (History)
2 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 NOT_REPRODUCIBLE

Description Dv.Mohamed 2013-08-31 13:00:24 UTC
Hello Guys,

I'm trying to bind the the Parse Android Java SDK to Xamarin.Android

I've followed this tutorial http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)

I've added Parse_1.3.4.jar as an EmbeddedJar and android-support-v4.jar and Facebook_Android_SDK_v3.5.jar, as EmbeddedReferenceJar

I am using Visual Studio 2012, and when building the project I get 1 error ("java.exe" exited with code 1 ) and 12 warnings. The output is as follows:

1>------ Build started: Project: CompanyII.Blink.Mobile.Android.JLibrary, Configuration: Debug Any CPU ------
1>Build started 31/08/2013 17:22:14.
1>ResolveLibraryProjects:
1>Skipping target "ResolveLibraryProjects" because it has no inputs.
1>_ResolveMonoAndroidSdks:
1>  MonoAndroid Tools: C:\Program Files (x86)\MSBuild\Xamarin\Android\
1>  MonoAndroid Framework: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.2\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\
1>  Android SDK: C:\Users\Account\Android_Dev\sdk\
1>  Java SDK: C:\Program Files\Java\jdk1.7.0_25\
1>  Android Platform API level: 17
1>  TargetFrameworkVersion: v4.2
1>ExportJarToXml:
1>    Assemblies: 
1>      C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.2\Mono.Android.dll
1>      C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll
1>      C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll
1>    Jars: 
1>    ResolvedResourceDirectories: 
1>    SourceJars:
1>      Jars\Parse-1.3.4.jar
1>    ReferenceJars:
1>      Jars\Facebook_Android_SDK_v3.5.jar
1>      Jars\android-support-v4.jar
1>  C:\Program Files\Java\jdk1.7.0_25\bin\java.exe -jar "C:\Program Files (x86)\MSBuild\Xamarin\Android\jar2xml.jar" --jar=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\Parse-1.3.4.jar --ref=C:\Users\Account\Android_Dev\sdk\platforms\android-17\android.jar --out=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\obj\Debug\api.xml --ref=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\Facebook_Android_SDK_v3.5.jar --ref=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\android-support-v4.jar 
1>  Exception in thread "main" java.lang.InternalError: Enclosing method not found
1>      at java.lang.Class.getEnclosingMethod(Class.java:952)
1>      at sun.reflect.generics.scope.ClassScope.computeEnclosingScope(ClassScope.java:50)
1>      at sun.reflect.generics.scope.AbstractScope.getEnclosingScope(AbstractScope.java:74)
1>      at sun.reflect.generics.scope.AbstractScope.lookup(AbstractScope.java:90)
1>      at sun.reflect.generics.factory.CoreReflectionFactory.findTypeVariable(CoreReflectionFactory.java:110)
1>      at sun.reflect.generics.visitor.Reifier.visitTypeVariableSignature(Reifier.java:165)
1>      at sun.reflect.generics.tree.TypeVariableSignature.accept(TypeVariableSignature.java:43)
1>      at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
1>      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
1>      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
1>      at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
1>      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
1>      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
1>      at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:100)
1>      at java.lang.Class.getGenericInterfaces(Class.java:814)
1>      at jar2xml.JavaClass.getGenericInterfaces(JavaClass.java:212)
1>      at jar2xml.JavaClass.doAppendToDocument(JavaClass.java:593)
1>      at jar2xml.JavaClass.appendToDocument(JavaClass.java:544)
1>      at jar2xml.JavaPackage.appendToDocument(JavaPackage.java:72)
1>      at jar2xml.Start.main(Start.java:119)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets(245,5): error MSB6006: "java.exe" exited with code 1.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.17
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Comment 1 Dv.Mohamed 2013-09-01 11:29:31 UTC
Update:

When I click on the error it takes me to the Xamarin.Android.Bindings.targets file, line 245 which has <JarToXml function/field which seems to be the cause of the problem.

Xamarin.Android.Bindings.targets is located in C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets

I've copied it below in case it might help

<!--
***********************************************************************************************
Xamarin.Android.Bindings.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
  created a backup copy.  Incorrect changes to this file will make it
  impossible to load or build your projects from the command-line or the IDE.

This file imports the version- and platform-specific targets for the project importing
this file. This file also defines targets to produce an error if the specified targets
file does not exist, but the project is built anyway (command-line or IDE build).

Copyright (C) 2012 Xamarin Inc. All rights reserved.
***********************************************************************************************
-->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="Xamarin.Android.Tasks.BindingsGenerator" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.GetApiLevelFromFramework" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.JarToXml" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.CollectLibraryInputJars" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.CreateLibraryResourceArchive" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.CreateTemporaryDirectory" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.RemoveDirFixed" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.ResolveAssemblies" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.ResolveLibraryProjectImports" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.ResolveSdks" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
  <UsingTask TaskName="Xamarin.Android.Tasks.CreateNativeLibraryArchive" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />

  <PropertyGroup>
    <AndroidUseLatestPlatformSdk Condition="'$(AndroidUseLatestPlatformSdk)' == ''">False</AndroidUseLatestPlatformSdk>
    <TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
    <MonoAndroidVersion>v1.0</MonoAndroidVersion>
  </PropertyGroup>
  
  <!-- Get our Build Actions to show up in VS -->
  <ItemGroup>
    <AvailableItemName Include="EmbeddedJar" />
    <AvailableItemName Include="EmbeddedNativeLibrary" />
    <AvailableItemName Include="EmbeddedReferenceJar" />
    <AvailableItemName Include="InputJar" />
    <AvailableItemName Include="ReferenceJar" />
    <AvailableItemName Include="TransformFile" />
    <AvailableItemName Include="LibraryProjectProperties" />
    <AvailableItemName Include="LibraryProjectZip" />
  </ItemGroup>

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />

  <!-- workaround for broken ResolveReferences deps in xbuild 2.8 -->
  <PropertyGroup>
    <ResolveReferencesDependsOn>GetFrameworkPaths;$(ResolveReferencesDependsOn)</ResolveReferencesDependsOn>
  </PropertyGroup>

  <!-- override GetFrameworkPaths since xbuild doesn't yet support TargetFrameworkIdentifier -->
  <Target Name="GetFrameworkPaths" DependsOnTargets="_ResolveMonoAndroidSdks" Condition="'$(OS)' == 'Unix'">
    <CreateItem Include="$(_MonoAndroidFrameworkDirectories)">
      <Output TaskParameter="Include" ItemName="TargetFrameworkDirectories"/>
      <Output TaskParameter="Include" ItemName="_FrameworkPath"/>
    </CreateItem>
    <CreateProperty Value="smcs">
      <Output TaskParameter="Value" PropertyName="CscToolExe"/>
    </CreateProperty>
    <CreateProperty Value="$(_MonoAndroidToolsDirectory)../../bin/">
      <Output TaskParameter="Value" PropertyName="CscToolPath"/>
    </CreateProperty>
    <CreateProperty Value="@(TargetFrameworkDirectories)">
      <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
      <!-- Workaround: Set $(_TargetFrameworkDirectories), so that GetReferenceAssemblyPaths doesn't
		     try to resolve the $(TargetFrameworkMoniker), as this target file doesn't support that
		     with xbuild, yet. -->
      <Output TaskParameter="Value" PropertyName="_TargetFrameworkDirectories" Condition="'$(OS)' == 'Unix'"/>
    </CreateProperty>
  </Target>

  <!--
    On Windows/MSBuild, use the MSBuild 4.0 TargetFrameworkVersion and reference
    assemblies system to resolve the MonoAndroid framework directories
  -->
  <Target Name="_ResolveMonoAndroidFrameworkWindows" Condition="'$(Os)'!='Unix'" DependsOnTargets="GetReferenceAssemblyPaths" >
    <!-- MSBuild is going to calculate this for us -->
    <CreateProperty Value="$(_TargetFrameworkDirectories)" Condition="'$(MonoAndroidFrameworkDirectories)'==''">
      <Output TaskParameter="Value" PropertyName="MonoAndroidFrameworkDirectories"/>
    </CreateProperty>
  </Target>

  <PropertyGroup>
    <GeneratedOutputPath Condition="'$(GeneratedOutputPath)' == ''">$(IntermediateOutputPath)generated\</GeneratedOutputPath>
    <ApiOutputFile Condition="'$(ApiOutputFile)' == ''">$(IntermediateOutputPath)api.xml</ApiOutputFile>
    <_GeneratorStampFile>$(IntermediateOutputPath)generator.stamp</_GeneratorStampFile>
  </PropertyGroup>

  <PropertyGroup>
    <BuildDependsOn>
      GetFrameworkPaths;
      AddLibraryJarsToBind;
      AddBindingsToCompile;
      AddEmbeddedJarsAsResources;
      AddEmbeddedReferenceJarsAsResources;
      AddLibraryProjectsToCompile;
      _AddNativeLibraryArchiveToCompile;
      $(BuildDependsOn);
    </BuildDependsOn>

    <CleanDependsOn>
      $(CleanDependsOn);
      CleanBindingsOutput;
      CleanLibraryProjectIntermediaries;
    </CleanDependsOn>
  </PropertyGroup>
  

  <!-- Find all the needed SDKs -->
  <Target Name="_ResolveMonoAndroidSdks" DependsOnTargets="_ResolveMonoAndroidFrameworkWindows">

    <ResolveSdks
        AndroidApiLevel="$(AndroidApiLevel)"
        AndroidSdkBuildToolsVersion="$(AndroidSdkBuildToolsVersion)"
        AndroidSdkPath="$(AndroidSdkDirectory)"
        BuildingInsideVisualStudio="$(BuildingInsideVisualStudio)"
        TargetFrameworkVersion="$(TargetFrameworkVersion)"
        UseLatestAndroidPlatformSdk="$(AndroidUseLatestPlatformSdk)">
      <Output TaskParameter="AndroidApiLevel" PropertyName="_AndroidApiLevel" />
      <Output TaskParameter="TargetFrameworkVersion" PropertyName="_TargetFrameworkVersion" />
      <Output TaskParameter="AndroidSdkPath" PropertyName="AndroidSdkDirectory" Condition="'$(AndroidSdkDirectory)'==''" />
      <Output TaskParameter="JavaSdkPath" PropertyName="JavaSdkDirectory" Condition="'$(JavaSdkDirectory)'==''" />
      <Output TaskParameter="MonoAndroidToolsPath" PropertyName="MonoAndroidToolsDirectory" Condition="'$(MonoAndroidToolsDirectory)'==''" />
      <Output TaskParameter="MonoAndroidFrameworkPath" PropertyName="MonoAndroidFrameworkDirectories" Condition="'$(MonoAndroidFrameworkDirectories)'==''" />
    </ResolveSdks>

    <Error Text="Could not locate MonoAndroid SDK." Condition="'$(MonoAndroidToolsDirectory)'=='' Or '$(MonoAndroidFrameworkDirectories)'==''" />
    <Error Text="Could not locate Android SDK." Condition="'$(AndroidSdkDirectory)'==''" />
    <Error Text="Could not locate Java 6 or 7 SDK.  (Download from http://www.oracle.com/technetwork/java/javase/downloads.)" Condition="'$(JavaSdkDirectory)'==''" />

    <!-- ensure a version of paths with trailing slashes even if overridden by /p:foo=bar -->
    <CreateProperty Value="$(MonoAndroidToolsDirectory)">
      <Output TaskParameter="Value" PropertyName="_MonoAndroidToolsDirectory"/>
    </CreateProperty>
    <CreateProperty Value="$(_MonoAndroidToolsDirectory)\">
      <Output TaskParameter="Value" PropertyName="_MonoAndroidToolsDirectory"
        Condition="!HasTrailingSlash('$(_MonoAndroidToolsDirectory)')" />
    </CreateProperty>

    <CreateProperty Value="$(AndroidSdkDirectory)">
      <Output TaskParameter="Value" PropertyName="_AndroidSdkDirectory"/>
    </CreateProperty>
    <CreateProperty Value="$(_AndroidSdkDirectory)\">
      <Output TaskParameter="Value" PropertyName="_AndroidSdkDirectory"
        Condition="!HasTrailingSlash('$(_AndroidSdkDirectory)')" />
    </CreateProperty>

    <CreateProperty Value="$(JavaSdkDirectory)">
      <Output TaskParameter="Value" PropertyName="_JavaSdkDirectory"/>
    </CreateProperty>
    <CreateProperty Value="$(_JavaSdkDirectory)\">
      <Output TaskParameter="Value" PropertyName="_JavaSdkDirectory"
        Condition="!HasTrailingSlash('$(_JavaSdkDirectory)')" />
    </CreateProperty>

    <CreateProperty Value="$(MonoAndroidFrameworkDirectories)">
      <Output TaskParameter="Value" PropertyName="_MonoAndroidFrameworkDirectories"/>
    </CreateProperty>

    <Message Text="MonoAndroid Tools: $(_MonoAndroidToolsDirectory)"/>
    <Message Text="MonoAndroid Framework: $(_MonoAndroidFrameworkDirectories)"/>
    <Message Text="Android SDK: $(_AndroidSdkDirectory)"/>
    <Message Text="Java SDK: $(_JavaSdkDirectory)"/>
    <Message Text="Android Platform API level: $(_AndroidApiLevel)"/>
    <Message Text="TargetFrameworkVersion: $(_TargetFrameworkVersion)"/>


    <!-- Misc paths -->
    <CreateProperty Value="$(_AndroidSdkDirectory)tools\">
      <Output TaskParameter="Value" PropertyName="_AndroidToolsDirectory"/>
    </CreateProperty>

    <CreateProperty Value="$(_AndroidSdkDirectory)platform-tools\">
      <Output TaskParameter="Value" PropertyName="_AndroidPlatformToolsDirectory"/>
    </CreateProperty>
  </Target>

<!-- This target is copied from Common.targets -->
<!-- We want to call ResolveAssemblyReferences to resolve our references, 
     but if we call the real one now, it won't run again when it's normally
     supposed to, so we run a copy of it here instead. -->
<Target Name="_AndroidResolveAssemblyReferencesBinding" DependsOnTargets="GetFrameworkPaths">
  <CreateItem Include="@(Reference)" Exclude="$(AdditionalExplicitAssemblyReferences)">
    <Output TaskParameter="Include" ItemName="_AndroidReference"/>
  </CreateItem>

  <CreateItem Include="$(AdditionalExplicitAssemblyReferences)">
    <Output TaskParameter="Include" ItemName="_AndroidReference"/>
  </CreateItem>

  <ResolveAssemblyReference
  Assemblies="@(_AndroidReference)"
  AssemblyFiles="@(ChildProjectReferences)"
  SearchPaths="$(AssemblySearchPaths)"
  CandidateAssemblyFiles="@(Content);@(None)"
  TargetFrameworkDirectories="$(TargetFrameworkDirectory)"
  AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
  AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)"
  FindDependencies="true"
  FindSatellites="true"
  FindRelatedFiles="true"
  TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
  TargetFrameworkVersion="$(_TargetFrameworkVersion)"
>
    <Output TaskParameter="ResolvedFiles" ItemName="_AndroidResolvedFiles"/>
    <Output TaskParameter="ResolvedFiles" ItemName="_AndroidReferencePath"/>
    <Output TaskParameter="ResolvedDependencyFiles" ItemName="_AndroidResolvedDependencyFiles"/>
    <Output TaskParameter="RelatedFiles" ItemName="_AndroidReferenceRelatedPaths"/>
    <Output TaskParameter="SatelliteFiles" ItemName="_AndroidReferenceSatellitePaths"/>
    <Output TaskParameter="CopyLocalFiles" ItemName="_AndroidReferenceCopyLocalPaths"/>
  </ResolveAssemblyReference>
</Target>
  

  <Target Name="ExportJarToXml"
          DependsOnTargets="_ResolveMonoAndroidSdks;_AndroidResolveAssemblyReferencesBinding"
          Inputs="@(EmbeddedJar);@(EmbeddedReferenceJar);@(InputJar);@(ReferenceJar);$(MSBuildAllProjects)"
          Outputs="$(ApiOutputFile)">

    <CreateTemporaryDirectory>
      <Output TaskParameter="TemporaryDirectory" PropertyName="Jar2XmlIntermediateOutputPath" />
    </CreateTemporaryDirectory>

    <!-- Build reference projects, in case they changed -->
    <MSBuild Projects="@(ProjectReference)" Targets="Build">
      <Output TaskParameter="TargetOutputs" ItemName="ResolvedLibraryOutputs" />
    </MSBuild>
    
    <ResolveLibraryProjectImports
      Assemblies="@(_AndroidReferencePath)"
      OutputDirectory="$(Jar2XmlIntermediateOutputPath)"
      OutputImportDirectory="$(Jar2XmlIntermediateOutputPath)__library_projects__\">
      <Output TaskParameter="Jars" PropertyName="ZippedLibraryProjectJars" />
    </ResolveLibraryProjectImports>
	
    <CreateItem Include="$(ZippedLibraryProjectJars)">
      <Output TaskParameter="Include" ItemName="ReferenceJar" />
    </CreateItem>

    <!-- Extract the API from the .jar file and store as .xml -->
    <JarToXml
      JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
      JavaOptions="$(JavaOptions)"
      AndroidSdkDirectory="$(_AndroidSdkDirectory)"
      MonoAndroidToolsDirectory="$(MonoAndroidToolsDirectory)"
      JavaSdkDirectory="$(_JavaSdkDirectory)"
      AndroidApiLevel="$(_AndroidApiLevel)"
      OutputFile="$(ApiOutputFile)"
      SourceJars="@(EmbeddedJar);@(InputJar)"
      ReferenceJars="@(EmbeddedReferenceJar);@(ReferenceJar)"
      DroidDocPaths="$(DroidDocPaths)"
      JavaDocPaths="$(JavaDocPaths)"
      LibraryProjectJars="$(IntermediateOutputPath)__library_projects__\*.jar"
    />
    
    <!-- Delete our temporary directory -->
    <RemoveDirFixed Directories="$(Jar2XmlIntermediateOutputPath)" />

  </Target>

  <Target Name="GenerateBindings"
          DependsOnTargets="ExportJarToXml;_ResolveMonoAndroidSdks;ResolveReferences"
          Inputs="$(ApiOutputFile);@(TransformFile);@(_ResolveAssemblyReferenceResolvedFiles);$(MSBuildAllProjects)"
          Outputs="$(_GeneratorStampFile)">

    <!-- Delete previous generated files if they still exist -->
    <RemoveDirFixed Directories="$(GeneratedOutputPath)" Condition="Exists ('$(GeneratedOutputPath)')" />

    <!-- MSBuild and xbuild call these different things, grab both -->
    <CreateItem Include="@(_ResolveAssemblyReferenceResolvedFiles);@(ResolvedFiles)">
      <Output TaskParameter="Include" ItemName="_ReferencedManagedLibraries"/>
    </CreateItem>

    <!-- Create the .cs binding source files -->
    <BindingsGenerator
      OutputDirectory="$(GeneratedOutputPath)src"
      EnumDirectory="$(GeneratedOutputPath)enums"
      EnumMetadataDirectory="$(GeneratedOutputPath)metadata"
      AndroidApiLevel="$(_AndroidApiLevel)"
      ApiXmlInput="$(ApiOutputFile)"
      AssemblyName="$(AssemblyName)"
      TransformFiles="@(TransformFile)"
      ReferencedManagedLibraries="@(_ReferencedManagedLibraries)"
      MonoAndroidToolsDirectory="$(_MonoAndroidToolsDirectory)"
      MonoAndroidFrameworkDirectories="$(MonoAndroidFrameworkDirectories)"
    />

    <!-- Write a flag so we won't redo this target if nothing changed -->
    <Touch Files="$(_GeneratorStampFile)" AlwaysCreate="true" />

  </Target>

  <Target Name="AddBindingsToCompile" DependsOnTargets="GenerateBindings">
    <!-- Add the files to list of things to be compiled -->
    <CreateItem Include="$(IntermediateOutputPath)generated\*\*.cs">
      <Output TaskParameter="Include" ItemName="Compile" />
    </CreateItem>
  </Target>

  <Target Name="AddEmbeddedJarsAsResources" DependsOnTargets="GenerateBindings">
    <CreateItem Include="@(EmbeddedJar)">
      <Output TaskParameter="Include" ItemName="EmbeddedResource" />
    </CreateItem>
  </Target>

  <Target Name="AddEmbeddedReferenceJarsAsResources" DependsOnTargets="GenerateBindings">
    <CreateItem Include="@(EmbeddedReferenceJar)"
                AdditionalMetadata="LogicalName=__reference__%(FileName)%(Extension)">
      <Output TaskParameter="Include" ItemName="EmbeddedResource" />
    </CreateItem>
  </Target>

  <Target Name="AddLibraryProjectsToCompile" DependsOnTargets="ResolveLibraryProjects">
    <CreateItem Include="$(IntermediateOutputPath)__AndroidLibraryProjects__.zip"
        Condition="Exists ('$(IntermediateOutputPath)__AndroidLibraryProjects__.zip')"
        AdditionalMetadata="LogicalName=__AndroidLibraryProjects__.zip">
      <Output TaskParameter="Include" ItemName="EmbeddedResource" />
    </CreateItem>
  </Target>
  
  <Target Name="ResolveLibraryProjects"
      Inputs="@(LibraryProjectProperties);@(LibraryProjectZip)"
      Outputs="$(IntermediateOutputPath)__AndroidLibraryProjects__.zip">
    <CreateLibraryResourceArchive
      OutputDirectory="$(IntermediateOutputPath)library_project_imports"
      OutputJarsDirectory="$(IntermediateOutputPath)library_project_jars"
      LibraryProjectPropertiesFiles="@(LibraryProjectProperties)"
      LibraryProjectZipFiles="@(LibraryProjectZip)" />
  </Target>

  <Target Name="AddLibraryJarsToBind" DependsOnTargets="ResolveLibraryProjects">
    <CreateItem Include="$(IntermediateOutputPath)library_project_jars\\*.jar">
      <Output TaskParameter="Include" ItemName="InputJar" />
    </CreateItem>
  </Target>

  <Target Name="CleanBindingsOutput">

    <Delete Files="$(ApiOutputFile)" />
    <Delete Files="$(_GeneratorStampFile)" />

    <RemoveDirFixed Directories="$(GeneratedOutputPath)" Condition="Exists ('$(GeneratedOutputPath)')" />

  </Target>
  
  <Target Name="CleanLibraryProjectIntermediaries">
    <Delete Files="$(IntermediateOutputPath)__AndroidLibraryProjects__.zip" />
    <RemoveDirFixed Directories="$(IntermediateOutputPath)library_project_jars" Condition="Exists ('$(IntermediateOutputPath)library_project_jars')" />
    <RemoveDirFixed Directories="$(IntermediateOutputPath)library_project_imports" Condition="Exists ('$(IntermediateOutputPath)library_project_imports')" />
  </Target>

  <Target Name="_CreateNativeLibraryArchive"
          Condition="@(EmbeddedNativeLibrary) != ''" 
          Inputs="@(EmbeddedNativeLibrary)"
          Outputs="$(IntermediateOutputPath)__AndroidNativeLibraries__.zip">
    <CreateNativeLibraryArchive
      OutputDirectory="$(IntermediateOutputPath)native_library_imports"
      EmbeddedNativeLibraries="@(EmbeddedNativeLibrary)" />
  </Target>

  <Target Name="_AddNativeLibraryArchiveToCompile" DependsOnTargets="_CreateNativeLibraryArchive">
    <CreateItem Include="$(IntermediateOutputPath)__AndroidNativeLibraries__.zip"
                Condition="Exists ('$(IntermediateOutputPath)__AndroidNativeLibraries__.zip')"
                AdditionalMetadata="LogicalName=__AndroidNativeLibraries__.zip">
      <Output TaskParameter="Include" ItemName="EmbeddedResource" />
    </CreateItem>
  </Target>

</Project>
Comment 2 Atsushi Eno 2013-09-13 06:26:01 UTC
There are many things to point out:

- there is Parse library in Xamarin component store so that you shouldn't need to build your own http://components.xamarin.com/view/parse/
- You should not use facebook 3.5 SDK *jar* file at all because it is an Android Library project which does not contain required Android resources and will cause *run time* exception for missing resources.
  - There already is Facebook SDK binding (sample) at https://github.com/xamarin/monodroid-samples/tree/master/Facebook so you should rather build and use it.
- Also adding Facebook library and support-v4.jar as (Embedded)ReferenceJars is inappropriate, as those API would also be used in the public API of Parse Java API. Any publicly-exposed API needs managed binding, which means (Embedded)ReferenceJar is not enough. It must be EmbeddedJar. But furthermore, you should just use existing managed binding dlls (Mono.Android.Support.v4.dll, and Facebook binding I mentioned above). You don't have to try to manually bind. You will be stuck at adding metadata fixup.

Apart from all above, I couldn't reproduce the missing type error at "JarToXml" step, with Mono.Android.Support.v4.dll and facebook 3.5 sdk *jar* (as I mentioned, it is *wrong*; I did it only because it is enough for me to use it to try to reproduce this bug).

If you still have any particular reason you have to bind things manually in your own way, please provide how you tried to build it; OS, IDE and Xamarin versions (studio, android).
Comment 3 aruna007001 2015-03-26 05:35:03 UTC
hi i am trying to create new android project in visual studio 2013
But in first build only i am getting the error

Error	1	The "Xamarin.Android.Tasks.GetApiLevelFromFramework" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.	ClassLibrary1
Error	2	Could not determine mandroid path!	App1
Error	3	The "Xamarin.Android.Tasks.GetApiLevelFromFramework" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.	App1

Please help me
Comment 4 aruna007001 2015-03-26 05:38:29 UTC
hi i am trying to create new android project in visual studio 2013
But in first build only i am getting the error

Error	1	The "Xamarin.Android.Tasks.GetApiLevelFromFramework" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.	ClassLibrary1
Error	2	Could not determine mandroid path!	App1
Error	3	The "Xamarin.Android.Tasks.GetApiLevelFromFramework" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.	App1

Please help me
Comment 5 Atsushi Eno 2015-03-26 05:50:56 UTC
Please don't take random bug report and add irrelevant comments. You can ask your questions at forums.xamarin.com.