All "getSupportMediaController()" cannot be resolved
See original GitHub issueAll 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:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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)
andMediaControllerCompat.getMediaController(Activity)
.See MediaControllerCompat.