diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs index b12c91214..39d1fadbb 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs @@ -252,18 +252,22 @@ namespace Xamarin.Android.Tasks // Framework assemblies don't come from outside the SDK Path; // user assemblies do if (checkSdkPath && treatAsUser && TargetFrameworkDirectories != null) { - return TargetFrameworkDirectories - // TargetFrameworkDirectories will contain a "versioned" directory, - // e.g. $prefix/lib/xbuild-frameworks/MonoAndroid/v1.0. - // Trim off the version. - .Select (p => Path.GetDirectoryName (p.TrimEnd (Path.DirectorySeparatorChar))) - .Any (p => assembly.StartsWith (p)); + return ExistsInFrameworkPath (assembly); } #endif return true; } + return TargetFrameworkDirectories == null || !checkSdkPath ? false : ExistsInFrameworkPath (assembly); + } - return false; + public static bool ExistsInFrameworkPath (string assembly) + { + return TargetFrameworkDirectories + // TargetFrameworkDirectories will contain a "versioned" directory, + // e.g. $prefix/lib/xbuild-frameworks/MonoAndroid/v1.0. + // Trim off the version. + .Select (p => Path.GetDirectoryName (p.TrimEnd (Path.DirectorySeparatorChar))) + .Any (p => assembly.StartsWith (p)); } public static bool IsForceRetainedAssembly (string assembly) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index deb521809..56fc48774 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -19,6 +19,7 @@ <_SharedRuntimeAssemblies Include="@(MonoProfileAssembly->'$(_SharedRuntimeBuildPath)v1.0\%(Identity)')" /> <_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)v1.0\Mono.Data.Sqlite.dll" /> <_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)v1.0\Mono.Posix.dll" /> + <_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)v1.0\Java.Interop.dll" /> <_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)v1.0\System.EnterpriseServices.dll" /> <_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)$(AndroidFrameworkVersion)\Mono.Android.Export.dll" /> diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 3eafd6643..3f80995cb 100755 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -2201,7 +2201,7 @@ because xbuild doesn't support framework reference assemblies. SupportedAbis="$(_BuildTargetAbis)" AndroidSequencePointsMode="$(_SequencePointsMode)" AotAdditionalArguments="$(AndroidAotAdditionalArguments)" - ResolvedAssemblies="@(_ResolvedAssemblies)" + ResolvedAssemblies="@(_ResolvedUserAssemblies);@(_ShrunkFrameworkAssemblies)" AotOutputDirectory="$(_AndroidAotBinDirectory)" IntermediateAssemblyDir="$(MonoAndroidIntermediateAssemblyDir)" LinkMode="$(AndroidLinkMode)"