Setup for Developing with the Cast Application Framework (CAF) for Android
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
Prerequisites for using the Google Cast SDK include installing the latest versions of the Android SDK, appcompat and mediarouter AndroidX Libraries, and the Cast SDK through the Android SDK Manager.
The Google Cast SDK for Android is part of the Google Play services SDK and does not need to be downloaded separately.
To use Google Play services APIs in your Android Studio project, add google() to your repositories and include a dependency for play-services-cast-framework in your build.gradle file.
For other IDEs, copy the Google Play services library project to your workspace, reference it in your app project, and add a <meta-data> tag for the Google Play services version in your app's manifest file.
Add ProGuard exceptions to prevent required classes from being stripped away.
Prerequisites
Install the latest version of the Android SDK using the Android SDK
Manager.
Select your development environment below and add Google Play services to your project by
following the steps provided.
Android Studio
To make the Google Play services APIs available to your app:
Open the build.gradle file inside your application module directory.
Note: Android Studio projects contain a top-level
build.gradle file and a build.gradle file for each module. Be sure to
edit the file for your application module. See
Building Your Project with Gradle for more information about Gradle.
Verify that google() is included in the listed repositories.
repositories {
google()
}
Add a new build rule under dependencies for the latest version of
play-services. For example:
Be sure you update this version number each time Google Play services is updated.
Note: If the number of method references in your app exceeds the
65K limit, your app may fail to
compile. You may be able to mitigate this problem when compiling your app by specifying only
the specific Google Play services APIs your app uses, instead of all of them. For information
on how to do this, see
Selectively compiling APIs into your executable.
Save the changes and click Sync Project with Gradle Files in the toolbar.
Other IDE
To make the Google Play services APIs available to your app:
Copy the library project at
<android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
to the location where you maintain your Android app projects.
Note: You should be referencing a copy of the library that you
copied to your development workspace—you should not reference the library directly from the
Android SDK directory.
After you've added the Google Play services library as a dependency for your app project,
open your app's manifest file and add the following tag as a child of the
<application> element:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-11 UTC."],[],[]]