Project compiles, like on Xamarin.Android 9.3.
Compilation error:
Target _CompileJava:
Directory "obj/Debug/android/bin/classes" doesn't exist. Skipping.
/Users/jonas/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25/bin/javac -J-Dfile.encoding=UTF8 -d obj/Debug/android/bin/classes -classpath /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v9.0/mono.android.jar:/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/java_runtime_fastdev.jar:obj/Debug/lp/0/jl/formsviewgroup.jar:obj/Debug/lp/1/jl/android.arch.core.common.jar:obj/Debug/lp/10/jl/bin/classes.jar:obj/Debug/lp/11/jl/com.android.support.collections.jar:obj/Debug/lp/12/jl/bin/classes.jar:obj/Debug/lp/13/jl/bin/classes.jar:obj/Debug/lp/14/jl/bin/classes.jar:obj/Debug/lp/15/jl/bin/classes.jar:obj/Debug/lp/16/jl/bin/classes.jar:obj/Debug/lp/17/jl/bin/classes.jar:obj/Debug/lp/18/jl/bin/classes.jar:obj/Debug/lp/19/jl/bin/classes.jar:obj/Debug/lp/2/jl/bin/classes.jar:obj/Debug/lp/20/jl/bin/classes.jar:obj/Debug/lp/21/jl/bin/classes.jar:obj/Debug/lp/22/jl/bin/classes.jar:obj/Debug/lp/23/jl/bin/classes.jar:obj/Debug/lp/24/jl/bin/classes.jar:obj/Debug/lp/25/jl/bin/classes.jar:obj/Debug/lp/26/jl/bin/classes.jar:obj/Debug/lp/27/jl/bin/classes.jar:obj/Debug/lp/28/jl/bin/classes.jar:obj/Debug/lp/29/jl/bin/classes.jar:obj/Debug/lp/3/jl/android.arch.lifecycle.common.jar:obj/Debug/lp/30/jl/bin/classes.jar:obj/Debug/lp/32/jl/bin/classes.jar:obj/Debug/lp/33/jl/bin/classes.jar:obj/Debug/lp/34/jl/bin/classes.jar:obj/Debug/lp/35/jl/bin/classes.jar:obj/Debug/lp/36/jl/bin/classes.jar:obj/Debug/lp/37/jl/bin/classes.jar:obj/Debug/lp/38/jl/bin/classes.jar:obj/Debug/lp/39/jl/bin/classes.jar:obj/Debug/lp/4/jl/bin/classes.jar:obj/Debug/lp/43/jl/bin/classes.jar:obj/Debug/lp/44/jl/bin/classes.jar:obj/Debug/lp/45/jl/bin/classes.jar:obj/Debug/lp/46/jl/common.jar:obj/Debug/lp/47/jl/bin/classes.jar:obj/Debug/lp/48/jl/bin/classes.jar:obj/Debug/lp/5/jl/bin/classes.jar:obj/Debug/lp/6/jl/bin/classes.jar:obj/Debug/lp/7/jl/bin/classes.jar:obj/Debug/lp/8/jl/bin/classes.jar:obj/Debug/lp/9/jl/com.android.support.support-annotations.jar -bootclasspath /Users/jonas/Library/Android/sdk/platforms/android-28/android.jar -encoding UTF-8 "@/var/folders/c8/w1k_9css1p17lw9288pp0bfw0000gn/T/tmp19026bba.tmp"
obj/Debug/android/src/md59c73ed0f6f0816547049fec1b3c815af/CalculatorWorker.java:4: error: cannot access ListenableFuture
public class CalculatorWorker
^
class file for com.google.common.util.concurrent.ListenableFuture not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
obj/Debug/android/src/md59c73ed0f6f0816547049fec1b3c815af/CalculatorWorker.java(4,8): error : error: cannot access ListenableFuture
obj/Debug/android/src/md59c73ed0f6f0816547049fec1b3c815af/CalculatorWorker.java(4,8): error : public class CalculatorWorker
obj/Debug/android/src/md59c73ed0f6f0816547049fec1b3c815af/CalculatorWorker.java(4,8): error : class file for com.google.common.util.concurrent.ListenableFuture not found
obj/Debug/android/src/md59c73ed0f6f0816547049fec1b3c815af/CalculatorWorker.java(4,8): error :
Done building target "_CompileJava" in project "WorkManagerCompilation.Android.csproj" -- FAILED.
Done building project "WorkManagerCompilation.Android.csproj" -- FAILED.
Build FAILED.
From Visual Studio for Mac
=== Visual Studio Community 2019 for Mac ===
Version 8.1.5 (build 9)
Installation UUID: c1e57dbd-db6c-4e43-9f30-8df655acc4c6
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.6.0.25 (d16-0 / 50f75273)
Package version: 518010028
=== Mono Framework MDK ===
Runtime:
Mono 5.18.1.28 (2018-08/223ea7ef92e) (64-bit)
Package version: 518010028
=== NuGet ===
Version: 5.0.2.5988
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.2.5
2.1.8
2.1.2
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.2.300/Sdks
SDK Versions:
2.2.300
2.2.107
2.1.504
2.1.302
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.10
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: 9.4.0.34 (Visual Studio Community)
Commit: xamarin-android/d16-2/7cce305
Android SDK: /Users/jonas/Library/Android/sdk
Supported Android versions:
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 29.0.0 rc1
Build Information:
Mono: mono/mono/2019-02@c6edaa62f94
Java.Interop: xamarin/java.interop/d16-2@b2b2610
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@4f717b6
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/jonas/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android Device Manager ===
Version: 1.2.0.44
Hash: aac645b
Branch: remotes/origin/d16-1
Build date: 2019-05-29 19:55:24 UTC
=== Xamarin Designer ===
Version: 16.1.0.467
Hash: f1657e133
Branch: remotes/origin/d16-1-new-document-model
Build date: 2019-06-18 21:57:42 UTC
=== Apple Developer Tools ===
Xcode 10.2 (14490.120)
Build 10E125
=== Xamarin.Mac ===
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
=== Xamarin.iOS ===
Version: 12.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:47-0400
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 801050009
Git revision: bd0ab28ba941b19b39322247db020dcd0fb305d0
Build date: 2019-07-03 17:15:21+00
Build branch: release-8.1
Xamarin extensions: 8cc25b5cb090e6c23b62a7901000c299977eb08d
=== Operating System ===
Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Fun stuff, if you:
It will work. But that's not very practical. ¯_(ツ)_/¯
VS bug #948417
The problem is this Xamarin.Google.Guava.ListenableFuture.dll assembly does not seem to have any markers that show this is a Xamarin.Android assembly:

This assembly contains no C# code. It does not have a TargetFrameworkIdentifier of MonoAndroid _or_ reference Mono.Android.dll.
We have a performance improvement in 16.1 that is breaking this... This DLL appears it just includes a guava-listenablefuture.jar EmbeddedResource file that makes _CompileJava work. But it is not even a Xamarin.Android assembly?!?
I will need to research what we should do about projects like this:
Ok, this seems like a very obscure MSBuild bug...
If I added an _empty_, Properties\AssemblyInfo.cs to this Xamarin.Google.Guava.ListenableFuture project, then the [assembly: TargetFramework] attribute appears...
Then I reviewed parts of MSBuild that do this:
<ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
<Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
<!-- Do not put in FileWrites: this is a file shared between projects in %temp%, and cleaning it would create a race between projects during rebuild -->
</ItemGroup>
In this Xamarin.Google.Guava.ListenableFuture project, the <Compile/> item group is completely empty. When I add a @(Compile) item of any kind the [assembly:TargetFramework] appears in the output assembly.
A workaround for this project might also be to set <TargetFrameworkMonikerAssemblyAttributeText>, so I'll see about sending a PR to XamarinComponents to fix this. I also need to see if there is a workaround for the current problem in the Xamarin.Android project that consumes this NuGet package.
Hi,
This has broken our build; does anyone know what the downgrade steps are for VS2019 on Windows?
Any time line as to when this will be fixed? Our builds have been broken due to this.
This was fixed in: https://github.com/xamarin/xamarin-android/pull/3362
We reopened this issue, so we could get approval to ship this fix in a service release for 16.2.
If you need a workaround, for now you can add this to the bottom of your Android app project's .csproj file:
<Target Name="FixGuava" AfterTargets="_AddAndroidCustomMetaData">
<ItemGroup>
<_MonoAndroidReferencePath Include="@(_ReferencePath);@(_ReferenceDependencyPaths)" Condition=" '%(Filename)' == 'Xamarin.Google.Guava.ListenableFuture' " />
</ItemGroup>
</Target>
</Project>
When a public fix is available, we'll close this and mention which version you can update to.
Thanks! This workaround worked for us.
Thank you Jonathan for the work-around.
This should be out now on the stable channel for VS Windows: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.1
Windows fix published. The new Xamarin.Android SDK version 9.4.1.0 that includes a fix for this issue has now been published as part of Visual Studio 2019 version 16.2.1. Check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/ to get the fix.
macOS fix published. The new Xamarin.Android SDK version 9.4.1.0 that includes a fix for this issue has now been released in the Stable updater channel in Visual Studio for Mac. Check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/ to get the fix.
Most helpful comment
This was fixed in: https://github.com/xamarin/xamarin-android/pull/3362
We reopened this issue, so we could get approval to ship this fix in a service release for 16.2.
If you need a workaround, for now you can add this to the bottom of your Android app project's
.csprojfile:When a public fix is available, we'll close this and mention which version you can update to.