Unable to resolve interface type Android - after upgrading

SSB 111 Reputation points
2021-12-13T09:57:35.713+00:00

Hi I have just upgraded Visual Studio for Mac and I am now getting an error when trying to build the Android project.

It always seems to be Android that has these problems......

....D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ShellItemRenderer.cs(0,0): Error XA4204: Unable to resolve interface type 'Google.Android.Material.Navigation.NavigationBarView/IOnItemSelectedListener'. Are you missing an assembly reference? (XA4204) (Android)

....D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\TabbedPageRenderer.cs(0,0): Error XA4204: Unable to resolve interface type 'Google.Android.Material.Navigation.NavigationBarView/IOnItemSelectedListener'. Are you missing an assembly reference? (XA4204) (Android)

I've got Xamarin.Forms 5.0.0.2244 package installed - please let me know if you need any other info to help fix this.

Here is my Visual Studio information:

Visual Studio Community 2019 for Mac
Version 8.10.14 (build 17)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000140

Mono Framework MDK
Runtime:
Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit)
Package version: 612000140

Roslyn (Language Service)
3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

NuGet
Version: 5.9.0.7134

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/5.0.403/Sdks
SDK Versions:
5.0.403
5.0.202
5.0.201
5.0.103
5.0.102
5.0.101
3.1.415
3.1.408
3.1.407
3.1.406
3.1.405
3.1.404
3.1.403
3.1.302
3.1.301
3.1.300
3.1.200
3.1.102
3.1.101
3.1.100
3.0.101
2.1.701
2.1.505
2.1.503
2.1.4
2.0.0
1.0.0-preview2-003121
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.12
5.0.5
5.0.4
5.0.3
5.0.2
5.0.1
3.1.21
3.1.14
3.1.13
3.1.12
3.1.11
3.1.10
3.1.9
3.1.6
3.1.5
3.1.4
3.1.2
3.1.1
3.1.0
3.0.1
2.1.23
2.1.20
2.1.19
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.12
2.1.9
2.1.7
2.0.5
2.0.0
1.0.0

.NET Core 3.1 SDK
SDK: 3.1.415

Xamarin.Profiler
Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 12.0.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-11/f0e3c2d
Android SDK: /Users/ssb/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
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: 30.0.2
SDK Build Tools Version: 29.0.3

Build Information:
Mono: c633fe9
Java.Interop: xamarin/java.interop/d16-11@476bb5b
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 16.10.0.13
Hash: 1b81df5
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:32 UTC

Android Device Manager
Version: 16.10.0.15
Hash: 89dcc0b
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:52 UTC

Xamarin Designer
Version: 16.11.0.39
Hash: cd672761d
Branch: remotes/origin/d16-11
Build date: 2021-10-06 21:09:18 UTC

Apple Developer Tools
Xcode 13.1 (19466)
Build 13A1030d

Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS
Version: 15.2.0.17 (Visual Studio Community)
Hash: 738fde344
Branch: xcode13.1
Build date: 2021-11-09 02:45:16-0500

Build Information
Release ID: 810140017
Git revision: 6f93cf55df3b7747288286e2006057c7f088b838
Build date: 2021-11-12 09:50:18-05
Build branch: release-8.10

Operating System
Mac OS X 11.6.1
Darwin 20.6.0 Darwin Kernel Version 20.6.0
Tue Oct 12 18:33:42 PDT 2021
root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64

Developer technologies .NET Xamarin
{count} votes

Accepted answer
  1. JarvanZhang 23,971 Reputation points
    2021-12-14T01:54:00.36+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Error XA4204: Unable to resolve interface type 'Google.Android.Material.Navigation.NavigationBarView/IOnItemSelectedListener'. Are you missing an assembly reference? (XA4204) (Android)

    Xamarin.Forms 5.0.0.2244 requires the version of Xamarin.Google.Android.Material nuget to be '>= 1.4.0.2 && < 1.5.0', please install or update the package on the Android project.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.