The import android.support.v7.app.MediaRouteActionProvider cannot be resolved
Asked Answered
C

5

13

I am trying to use GoogleMap V2 .But i am getting error on import these :

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 the error is

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

Here is the screen shot of the library that i have added

enter image description here

What i have to do .I have tried to import android\support\v7 By Build path .But it is not resolving my issue in there any way so that i can resolve these errors.

Chapnick answered 19/2, 2014 at 9:39 Comment(15)
do you see the android-support-v4.jar in the projects libs folder?Piecemeal
@Piecemeal yes i have that i have imported that one also by build pathChapnick
then you error clearly says that is not the case . look at android-support-v4.jar from the support library under the sdk and add it to libs folderPiecemeal
i have already imported android-support-v4.jar and added to the libraryChapnick
then you will not get the error that you have just mentioned.Piecemeal
@Piecemeal see i have updated the code with a screenshotChapnick
@GauravPandey Attached image says that you are using wrong jar for v7. Actual path is <sdk>/extras/android/support/v7/appcompat/libs. Copy both jars from thereEmpanel
@GauravPandey GridLayout is a library project and must be referenced just like google play servicesPiecemeal
@GauravPandey did you reference or add it as a jar file?Piecemeal
@Piecemeal what u said those import error are gone now it is showing This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-inChapnick
@GauravPandey update the adt plugin for eclipsePiecemeal
@Piecemeal can we chat i have issue in this aapChapnick
@GauravPandey which chat room pls invitePiecemeal
@Piecemeal i am not getting that option to invite for a chat in this questionChapnick
@Piecemeal i am on the both chatChapnick
P
7

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

Its a library project with resources. You need to reference the library project in your android projet

This library is located in the <sdk>/extras/android/support/v7/gridlayout/ directory after you download the Android Support Libraries.

Follow Adding libraries with resources

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

Piecemeal answered 19/2, 2014 at 10:0 Comment(0)
S
6

had the same problem and found that the link in my project to the appcomcat_v7 project is broken (right-click project and choose properties, then head to the Android tab)...

i removed and then added the correct project and i was good to go...

enter image description here

Sorrel answered 26/6, 2014 at 15:27 Comment(1)
For anyone that is curious, the real project is located in: sdk\extras\android\support\v7Noaccount
N
1

These type of Errors generally occurs when we accidentally close these libraries(by close unrelated projects,etc) which are automatically generated In Project Explorer of Eclipse like:

  • 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 the errors in my app were vanished !

If It till then didn't work then do Project -> Properties -> Android -> Is Library -> Add.. -> And add appcompat_v7_*

Nosey answered 30/6, 2014 at 17:9 Comment(0)
C
0

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

When I then restarted Eclipse, I noticed a number of "appcompat_v7..." folders in my workspace directory. I deleted these - and maybe that was the cause of this problem.

But I resolved it by creating a new Test project in Eclipse, then restarting Eclipse to find all my projects compiled again! :)

I didn't need to change any project properties.

Cinthiacintron answered 16/8, 2014 at 13:30 Comment(0)
A
0

this solution worked for me:

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

enter image description here

Anis answered 14/11, 2014 at 18:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.