question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not resolve reference to 'Android.Support.V7.App.NotificationCompat/MediaStyle'...

See original GitHub issue

Hi,
I’ve been using your plugin for a new project and it worked really well (I do really owe you my compliments, a really clean and fast solution for medias) until I switched from Debug to Release.

When in release, trying to build the solution, I got an unresolvable error

Severity Code Description Project File Line Suppression State Error The "LinkAssemblies" task failed unexpectedly. Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'Android.Support.V7.App.NotificationCompat/MediaStyle' (defined in assembly 'Plugin.MediaManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve Android.Support.V7.App.NotificationCompat/MediaStyle at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference) at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type) at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type) at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.MarkStep.Initialize() at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) --- End of inner exception stack trace --- at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args) at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() SmartCity.Android

The project has latest Xamarin.Forms tools and latest Xamarin.Android tools, here details:

  • NETStandard.Library, installed in: PCL v2.0.3
  • Xamarin.Android.Support.Design, installed in: Project.Android v27.0.2.1
  • Xamarin.Android.Support.v4, installed in: Project.Android v27.0.2.1
  • Xamarin.Android.Support.v7.AppCompat, installed in: Project.Android v27.0.2.1
  • Xamarin.Android.Support.v7.CardView, installed in: Project.Android v27.0.2.1
  • Xamarin.Android.Support.v7.MediaRouter, installed in: Project.Android v27.0.2.1
  • Xamarin.Forms, installed in each project (PCL, Android, iOS), v3.1.0.697
  • Plugin.MediaManager, installed in each proj(PCL, Android, iOS), v0.4.5

This packages (exception made for Plugin.MediaManager obviously) are the default, generated by the system within the solution.

Steps to reproduce 📜

  1. Create new Xamarin.Forms PCL solution

  2. Install Plugin.MediaManager

  3. Switch build to Release

  4. Rebuild project

Things I tried

  1. Install Plugin.MediaManager.Forms in each project in the solution with and without Plugin.MediaManager installed

  2. Install Plugin.MediaManger only in Droid proj and installing Plugin.MediaManager.Forms in each project.

  3. Tried a lot of combinations, also tried to download latest stable branch and generate .dlls.

  4. To check if it was just my solution I tried to create a new, empty, PCL project, including both Android and iOS, when installing the NuGet it still gave me the same error.

Still couldn’t manage to solve the situation.

Expected behavior 🤔

Build in Release without errors

Actual behavior 🐛

Can’t build in Release

Configuration 🔧

Version: 0.4.5

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • [ x ] 🐒 Xamarin.Forms

Thank you for your help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
martijn00commented, Aug 31, 2018

As also said in a lot of other issues. This project is a lot of work, and it would help a lot if your company starts paying for what they use. I can provide an updated version a lot sooner when that happens, otherwise you got to wait until it is finished.

1reaction
arunkumarpediredlacommented, Nov 13, 2018

Hi once again rise the issue, Plugin.MediaManager is not working for Livestreaming RTSP Url based Here not working means, play, pause and stop not working

Can you please tell me the solution for this

I am waiting for reply

Thank You

Read more comments on GitHub >

github_iconTop Results From Across the Web

android.support.v4.media.app.NotificationCompat. ...
1 Answer 1 ... androidstudio (3.5.1) has a migrate to androidX function: right-click on root-folder of your project->Refactor->Migrate to AndroidX ...
Read more >
Issues
Could not resolve reference to 'Android.Support.V7. ... 'Android.Support.V7.App.NotificationCompat/MediaStyle' (defined in assembly 'Plugin.
Read more >
NotificationCompat.MediaStyle | Android Developers
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >
Failed resolution of: Landroid/support/v4/media/app ...
I am trying to wrap NotificationCompat.MediaStyle and it seems to compile fine but the application crashes immediately with this log ...
Read more >
error Xamarin forms release mode Android - Microsoft Q&A
ResolutionException: Failed to resolve Android.Support.V4.App.NotificationCompat/BuilderExtender in Mono.Linker.Steps.MarkStep.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found