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.

All "getSupportMediaController()" cannot be resolved

See original GitHub issue

All is OK, but “getSupportMediaController()” and “setSupportMediaController()” are red and cannot be resolved. I have updated dependencies as below: `dependencies { provided ‘com.google.android.wearable:wearable:2.0.5’

compile 'com.google.android.gms:play-services-cast-framework:11.0.4'
compile 'com.google.android.support:wearable:2.0.5'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:mediarouter-v7:26.0.0'
compile 'com.android.support:leanback-v17:26.0.0'
compile 'com.android.support:design:26.0.0'

compile 'com.google.android.exoplayer:exoplayer:r2.4.4'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:26.0.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'

}` Please help me out! Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
cfva14commented, Sep 25, 2017

Don’t update the dependencies. You are getting that error because in the support libraries 26+ they have removed the getSupportMediaController and setSupportMeriaController

Or use the new methods. MediaController.getMediacontroller() and MediaController.setMediaController.

I don’t remember if it is MediaControllerCompat.getMediaController() or MediaController.getMediaController().

Try both. I am in my cell phone.

2reactions
nic0lettecommented, Sep 26, 2017

As @cfva14 said, if you update the version of the support libraries to 26 (I’d recommend against that for the time being, unless you also want to update other parts of the code), then you’ll need to change those to use MediaControllerCompat.setMediaController(Activity, MediaControllerCompat) and MediaControllerCompat.getMediaController(Activity).

See MediaControllerCompat.

Read more comments on GitHub >

github_iconTop Results From Across the Web

All "getSupportMediaController()" cannot be resolved ... - GitHub
All is OK, but "getSupportMediaController()" and "setSupportMediaController()" are red and cannot be resolved. I have updated dependencies as ...
Read more >
Cannot resolve method; possible dependency issue
I'm using a MediaBrowsterCompat.ConnectionCallback and I want to use the setSupportedMediaController() and getSupportedMediaController() methods ...
Read more >
Support Library Revision Archive - Android Developers
This page provides details about older Support Library package releases. For the most recent Support Library releases, see Recent Support ...
Read more >
Background Audio in Android With MediaSessionCompat
You'll notice that the above code snippet uses getSupportMediaController().getTransportControls() to communicate with the media session. Using ...
Read more >
Cannot resolve method in Android Studio Error Solved
Cannot resolve symbol or Cannot resolve method and Find View By ID it is very common error while your development phase in Android...
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