Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Miss match on Xamarin.Android depencies for MediaElement #1908

Closed
2 tasks done
Jakar510 opened this issue May 29, 2024 · 6 comments
Closed
2 tasks done

[BUG] Miss match on Xamarin.Android depencies for MediaElement #1908

Jakar510 opened this issue May 29, 2024 · 6 comments
Labels
bug Something isn't working external When the issue should be fixed elsewhere needs discussion Discuss it on the next Monthly standup unverified

Comments

@Jakar510
Copy link

Jakar510 commented May 29, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

androidx.profileinstaller.ProfileInstaller.writeProfile
java.lang.ClassNotFoundException: Didn't find class "com.google.common.util.concurrent.ListenableFuture" on path: DexPathList

Known stack traces:

dalvik.system.BaseDexClassLoader.findClass BaseDexClassLoader.java:259
java.lang.ClassLoader.loadClass ClassLoader.java:379
java.lang.ClassLoader.loadClass ClassLoader.java:312
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:577
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:515
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:479
androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2 ProfileInstallerInitializer.java:145
androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1145
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java:644
java.lang.Thread.run Thread.java:1012



androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:577
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:515
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:479
androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2 ProfileInstallerInitializer.java:145
androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1145
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java:644
java.lang.Thread.run Thread.java:1012



java.lang.VMClassLoader.findLoadedClass VMClassLoader.java
java.lang.ClassLoader.findLoadedClass ClassLoader.java:738
java.lang.ClassLoader.loadClass ClassLoader.java:363
java.lang.ClassLoader.loadClass ClassLoader.java:312
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:577
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:515
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:479
androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2 ProfileInstallerInitializer.java:145
androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1145
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java:644
java.lang.Thread.run Thread.java:1012



androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:577
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:515
androidx.profileinstaller.ProfileInstaller.writeProfile ProfileInstaller.java:479
androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2 ProfileInstallerInitializer.java:145
androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1145
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java:644
java.lang.Thread.run Thread.java:1012

After some further research i found this Issue, So i tried to install Xamarin.Google.Guava.ListenableFuture v1.0.0.19 and nuget got this error:

NU1605: Warning As Error: Detected package downgrade: Xamarin.Google.Guava.ListenableFuture from 9999.0.0 to 1.0.0.19. Reference the package directly from the project to select a different version. 
 Project.Maui -> Shared.Maui -> CommunityToolkit.Maui.MediaElement 3.1.1 -> Xam.Plugins.Android.ExoPlayer 2.19.1 -> Xam.Plugins.Android.ExoPlayer.Common 2.19.1 -> Xamarin.Google.Guava 31.1.0.3 -> Xamarin.Google.Guava.ListenableFuture (>= 9999.0.0) 
 Project.Maui -> Xamarin.Google.Guava.ListenableFuture (>= 1.0.0.19)
 
 
NU1605: Warning As Error: Detected package downgrade: Xamarin.Google.Guava.ListenableFuture from 9999.0.0 to 1.0.0.19. Reference the package directly from the project to select a different version. 
 Project.Maui -> Shared.Maui -> CommunityToolkit.Maui.MediaElement 3.1.1 -> Xam.Plugins.Android.ExoPlayer.Transformer 2.19.1 -> Xam.Plugins.Android.ExoPlayer.Core 2.19.1 -> Xam.Plugins.Android.ExoPlayer.Common 2.19.1 -> Xamarin.Google.Guava 31.1.0.3 -> Xamarin.Google.Guava.ListenableFuture (>= 9999.0.0) 
 Project.Maui -> Xamarin.Google.Guava.ListenableFuture (>= 1.0.0.19)

Expected Behavior

Not crash on startup.

Steps To Reproduce

Create a MAUI project, add the CommunityToolkit.Maui.MediaElement and try to run it.

Link to public reproduction project repository

https://github.com/Jakar510/Jakar.Extensions/tree/master/TestMauiApp

Environment

Envrionment
Microsoft Visual Studio Professional 2022
Version 17.8.7
VisualStudio.17.Release.LTSC.17.8/17.8.7+34601.278
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Professional

Visual C++ 2022   00476-80000-00000-AA346
Microsoft Visual C++ 2022

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASA Service Provider   1.0

ASP.NET and Web Tools   17.8.358.6298
ASP.NET and Web Tools

ASP.NET Web Frameworks and Tools 2012   17.8.358.6298
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   17.8.358.6298
Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio   2.6.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   17.8.358.6298
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.6.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   17.0.23262.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Dotfuscator Community Edition   6.5.3+7f0b0a9d18
PreEmptive Protection - Dotfuscator CE

Extensibility Message Bus   1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Extension Manager 2022   1.3.4
Import/export extensions as well as associate extensions with individual solutions

File Icons   2.7
Adds icons for files that are not recognized by Solution Explorer

GitHub Copilot   1.181.0.1 (v1.181.0.1@b03e96737)
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

GitHub Copilot Agent   1.181.0

Linux Core Dump Debugging   1.0.9.34525
Enables debugging of Linux core dumps.

Microsoft Azure Hive Query Language Service   2.6.5000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.6.5000.0
Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio   2.9
Support for Azure Cloud Services projects

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.8.17 (957fbed)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.50908.1 Commit Hash:c294679b821c4b8f7f9c6db3827b7655db80fc28
Adds support for developing and debugging Node.js apps in Visual Studio

NpgsqlVSPackage Extension   1.0
NpgsqlVSPackage Visual Studio Extension Detailed Info

NuGet Package Manager   6.8.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Office Developer Tools for Visual Studio   17.6.34024.01
Microsoft Office Developer Tools for Visual Studio

Python - Django support   17.0.23262.1
Provides templates and integration for the Django web framework.

Python - Profiling support   17.0.23262.1
Profiling support for Python projects.

Python with Pylance   17.0.23262.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core)   17.8.3.2405201+d135dd8d2ec1c2fbdee220e8656b308694e17a4b
Provides languages services for ASP.NET Core Razor.

ResX Resource Manager   ResXManager
Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid.

SQL Server Data Tools   17.8.120.1
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   17.0.20920.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android)   15.0.34205.153
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   15.0.34205.153
Visual C++ for Cross Platform Mobile Development (iOS)

Visual C++ for Linux Development   1.0.9.34525
Visual C++ for Linux Development

Visual F# Tools   17.8.0-beta.23475.2+10f956e631a1efc0f7f5e49c626c494cd32b1f50
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

Visual Studio Tools for Unity   17.8.2.0
Visual Studio Tools for Unity

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   17.8.0.158 (d17-8@c134629)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.8.3.6 (remotes/origin/d17-8@eccf46a291)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.8.16 (830b56a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
	Mono: d9a6e87
	Java.Interop: xamarin/java.interop/d17-5@149d70fe
	SQLite: xamarin/sqlite/3.40.1@68c69d8
	Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d


Xamarin.iOS and Xamarin.Mac SDK   16.4.0.23 (9defd91b3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Anything else?

No response

@Jakar510 Jakar510 added bug Something isn't working unverified labels May 29, 2024
@bijington
Copy link
Contributor

I'm not sure it'll solve the issue but it doesn't look like you have applied this detail from the docs: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/mediaelement?tabs=android#platform-specific-initialization

@Jakar510
Copy link
Author

Jakar510 commented May 29, 2024

@bijington

I applied this detail and I got this VS Issue. So I rebooted windows and started it again. It took several minutes for VS to start the clean/build but it eventually ran.

I continued to get this error.

@pictos
Copy link
Member

pictos commented May 29, 2024

From your report, I don't think the issue is with this repo... Following your log I could find that Xamarin.Google.Guava has a dependency on Xamarin.Google.Guava.ListenableFuture, but the dependency requires a version greater than 999, which doesn't exist on nuget, so looks like the Xamarin.Android team is using a local package reference instead of the nuget feed.

cc: @moljac @jonathanpeppers.

@pictos pictos changed the title [BUG] [BUG] Miss match on Xamarin.Android depencies for MediaElement May 29, 2024
@pictos pictos added the external When the issue should be fixed elsewhere label May 29, 2024
@jpobst
Copy link

jpobst commented May 29, 2024

Version 9999.0.0 does exist on NuGet, it is just unlisted so it doesn't show up in searches:
https://www.nuget.org/packages/Xamarin.Google.Guava.ListenableFuture/9999.0.0

If I recall, the reason is that Guava and Guava.ListenableFuture both contain com.google.common.util.concurrent.ListenableFuture so if you reference them both you get a duplicate Java class.

Thus if you reference Guava we demand the 9999.0.0 dummy package that is empty, so only the ListenableFuture from Guava is pulled in.

In short, you do not want to reference both Guava and a specific version of Guava.ListenableFuture.

@Jakar510
Copy link
Author

Here's what i'm referencing directly

Screenshot 2024-05-29 151314

@Jakar510
Copy link
Author

Jakar510 commented Jun 6, 2024

I'm not sure what changed, but it no longer occurs.

@brminnick brminnick closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external When the issue should be fixed elsewhere needs discussion Discuss it on the next Monthly standup unverified
Projects
None yet
Development

No branches or pull requests

5 participants