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.

java.lang.ClassNotFoundException: Didn't find class "util.CastOptionsProvider"

See original GitHub issue

Hi, I have a problem using the cast to Chromecast option.

When I call: PlayServicesUtils.checkGooglePlayServicesAvailability(this, googlePlayServicesAvailabilityRequestCode, this::initChromecast);

I receive the error:

java.lang.ClassNotFoundException: Didn’t find class “util.CastOptionsProvider”

That is caused by -

private Unit initChromecast() {
        new ChromecastYouTubePlayerContext(
                CastContext.getSharedInstance(this).getSessionManager(),
                new SimpleChromecastConnectionListener()
        );

        return Unit.INSTANCE;
    }

More precisely by CastContext.getSharedInstance.

I have to mention that if I remove the cast button, the player works just fine. Am i missing something?

I have to mention that in my build.gradle I have those lines:

implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1'
    implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:chromecast-sender:0.15'

    implementation 'com.android.support:mediarouter-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-cast-framework:15.0.1'

    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'

Thank you!

PS: the cast doesn’t work from the app existing in play store either. I have tested with youtube and I can cast to my Chromecast directly from their app.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
juanvictorbascopecastrocommented, Jun 21, 2021

Hello I have the same problem in java, I have the application in Google Cast SDK Developer Console. I throw the error E/CastContext: Failed to load module from Google Play services. Cast will not work properly. Might due to outdated Google Play services. Ignoring this failure silently. I’m new to learning. And I loved this library where you can control everything congratulations.

The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.

1reaction
mateineagucommented, Oct 1, 2018

No worries - I am looking into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.ClassNotFoundException: Didn't find class on path
This is a solution for the Eclipse IDE. There is no default 'project.properties' file in Android Studio. It can be created though. –...
Read more >
Integrating FireStick Cast into Android App with Chromecast
Learn how to integrate FireStick Cast into Android App with Chromecast ... Caused by: java.lang.ClassNotFoundException: Didn't find class ...
Read more >
Integrate Cast Into Your Android App - Google Developers
This developer guide describes how to add Google Cast support to your Android sender app using the Android Sender SDK. Note: We recommend...
Read more >
ClassCastException after updating to R8 2.0.59 (Android ...
Fatal Exception: java.lang.ClassCastException: i2 cannot be cast to ii8$a at io.ktor.util.StringValuesSingleImpl.forEach(StringValuesSingleImpl.java:106) at ...
Read more >
Didn't find class "com.google.android.gms.measurement ...
at com.google.android.gms.ads.internal.util.b.run(:com.google.android.gms. ... java.lang.NoClassDefFoundError: Class not found using the boot class loader; ...
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