react-native-google-cast: [Android] Cannot resolve symbol 'CastContext'

Describe the bug When trying to setup the react-native-google-cast plugin, import symbols are not resolving.

Versions:

  • RNGC Library Version: “^4.0.0-beta.4”
  • Android Version (if applicable): buildToolsVersion = “29.0.2”

To Reproduce Steps to reproduce the behavior:

  1. Generate new project
  2. Try to follow Setup guide https://react-native-google-cast.github.io/docs/getting-started/setup

On import com.google.android.gms.cast.framework.CastContext; I get the error Cannot resolve symbol 'CastContext'

Expected behavior Expect it to work

Screenshots Screen Shot 2020-12-07 at 7 03 04 PM

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

The next button on the documentation doesn’t work on this page: https://react-native-google-cast.github.io/docs/getting-started/setup#android

Please forgive me as I work through this again today.

The docs don’t seem to reflect the situation on the ground, or perhaps they make an assumption about the knowledge of the reader.

  <meta-data
    android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
    android:value="com.reactnative.googlecast.GoogleCastOptionsProvider" />

The docs say to add this to AndroidManifest.xml, but a fresh RN project creates two. One in app/src/main the other in app/src/debug. Do I add it to both? Does it go inside the manifest tag or the application tag?

It should go to the one in app/src/main. app/src/debug adds additional attributes/permissions specific to development and is merged into the main one when building the app in debug mode. I can clarify that in the docs. (Btw I understand your confusion but this is a general Android rule; the documentation for this library can’t possibly cover all of the platform specifics 😃)