Import android.support.v7.app.MediaRouteActionProvider cannot be allowed

I am trying to use GoogleMap V2. But I get an error while importing:

import android.support.v7.app.MediaRouteActionProvider; import android.support.v7.media.MediaRouteSelector; import android.support.v7.media.MediaRouter; import android.support.v7.media.MediaRouter.RouteInfo; 

And mistake

 The import android.support.v7.app.MediaRouteActionProvider cannot be resolved 

Here is a screenshot of the library I added

enter image description here

What do I need to do. I tried to import android \ support \ v7 along the build path. But he does not solve my problem there in any way, so that I can resolve these errors.

+12
android android-maps-v2
Feb 19 '14 at 9:39
source share
5 answers

It looks like you added gridlayout.jar to the lib project folder.

His project is a library with resources. You must reference the library project in your android projet project

This library is located in the <sdk>/extras/android/support/v7/gridlayout/ after loading the Android support libraries.

Follow Adding Resource Libraries

http://developer.android.com/tools/support-library/setup.html#libs-with-res

+7
Feb 19 '14 at 10:00
source share

had the same problem and found that the link in my project in the appcomcat_v7 project is not working (right click on the project and select properties, then go to the android tab) ...

I deleted and then added the correct project, and I was fine ...

enter image description here

+6
Jun 26 '14 at 15:27
source share

This type of error usually occurs when we accidentally close these libraries (using close unrelated projects, etc.) that are automatically generated in Project Explorer Eclipse, for example:

  • appcompat_v7
  • appcompat_v7_2
  • appcompat_v7_3
  • appcompat_v7_4
  • appcompat_v7_5
  • appcompat_v7_6
  • appcompat_v7_7
  • appcompat_v7_8
  • appcompat_v7_9
  • appcompat_v7_10
  • appcompat_v7_11
  • appcompat_v7_12
  • appcompat_v7_13
  • appcompat_v7_14

As soon as I open these files, all errors in my application have disappeared!

If it did not work before, then Project -> Properties -> Android -> Is Library -> Add.. -> And add appcompat_v7_*

+1
Jun 30 '14 at 17:09
source share

I had a very similar problem with this after I used force to close Eclipse.

When I restarted Eclipse, I noticed several folders "appcompat_v7 ..." in my workspace directory. I deleted them - and perhaps this was the cause of this problem.

But I solved this by creating a new test project in Eclipse and then restarting Eclipse to find all my projects again! :)

I did not need to change any project properties.

0
Aug 16 '14 at 13:30
source share

this solution worked for me:

The android-support-v4.jar causes this conflict and you see an error: The import android.support.v7.app.MediaRouteActionProvider cannot be resolved , just delete the library in the / libs folder of your project, because the library is already in the appcompat_v7 library , clean and create your project, and your project will work like a charm!

enter image description here

0
Nov 14 '14 at 18:02
source share



All Articles