forked from Cameronjmayfield/cast-android-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL_CAST_ECLIPSE.txt
134 lines (90 loc) · 4.91 KB
/
INSTALL_CAST_ECLIPSE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Setting up the Cast SDK in Eclipse
To build one of the sample Android projects, you need to first set up your
workspace for Google Cast development. The following steps will take you
through setup and try to answer any questions relating to common errors and
mistakes in the process.
A. Before you Start
B. Support Library Setup
C. Cast SDK Setup
D. Common Errors
***
A. Before You Start:
1. Download the Cast SDK (developers.google.com/cast/downloads) and extract
it to an easily findable location.
2. Install the Android Support Libraries through the Android SDK Manager
(http://developer.android.com/tools/support-library/setup.html).
***
B. Support Library Setup:
To develop for Google Cast, you need both the Cast SDK and three Android
Support Libraries, listed below. All Android Support Libraries can be found
at (SDK install location)/extras/android/support/.
1. android-support-v4
2. android-support-v7-appcompat
3. android-support-v7-mediarouter
However, since v4 is bundled with v7-appcompat in the Android Support
Libraries, you will only need to install the two v7 support libraries listed.
See the below link for detailed step-by-step instructions for importing the
two v7 libraries into your workspace.
http://developer.android.com/tools/support-library/setup.html#libs-with-res
After creating both support libraries as projects in your workspace:
1. Right click on v7-mediarouter and select Properties.
2. Select Android, and in the Libraries list, add v7-appcompat.
If you still have build errors after the above steps, see the Common Errors
section at the end of this document.
***
C. Cast SDK Setup
You can either add the Cast SDK as a library project in your workspace, or add
the GoogleCastSdkAndroid-x.x.x.jar directly to the project you're building. The
former is recommended if you have multiple Cast-related projects in your
workspace.
As a library project: Follow the Support Library setup instructions linked
above for your downloaded and extracted SDK.
As an included library:
1. Copy the /libs folder from your downloaded SDK to your Cast-related project.
Make sure the folder is named libs, and not "lib" or something else similar.
2. You do not need to add the .jar to your build path if you name the folder
"libs". Your project should now compile without errors.
***
D. Common Errors
1. v7-appcompat: Unable to resolve target 'android-16'.
This is the result of android-support-v7-appcompat being initialized to
depend on the Android 4.1.2 (API 16) libraries, which you may not have
installed. You DO NOT NEED to install API 16 if you don't need it. To
fix this error:
1. Right click on the v7-appcompat project and select Properties.
2. Select Android and check the Project Build Target. If the current target
is listed as 17 or above, it's lying. Select a different target, select
"Apply", then re-select the desired target (> API 17) and hit "Apply"
again.
3. The errors should disappear. If you've selected API 17 or above and
"Unable to resolve target 'android-16'" errors persist, restart Eclipse.
2. v7-mediarouter: styles.xml won't recognize the parent class
'Widget.AppCompat.ActionButton'.
This error occurs when v7-mediarouter does not have v7-appcompat listed as
one of its required libraries, or v7-appcompat was not correctly configured.
Check the instructions for setting up Android Support Libraries again.
3. v7-mediarouter: v17/mr_media_route_list_item.xml won't recognize paddingEnd
or paddingStart as valid properties.
This error occurs when v7-mediarouter accidentally has its build target set
to an API version less than 17, perhaps as a result of installing API 16 to
deal with the "Unable to resolve target 'android-16'" error above. To fix
this error:
1. Right click on v7-appcompat and select Properties.
2. Select Android and set the Project Build Target to an API version higher
than 17.
3. The project may not immediately refresh, even if you hit Apply; to force
it to refresh without restarting Eclipse, remove v7-appcompat from the
Libraries list and hit Apply.
4. Then re-add v7-appcompat to the Libraries list and hit Apply again. This
will re-build v7-mediarouter with the correct API target.
4. My Cast project won't recognize Cast-related classes/claims com.google.cast.
doesn't exist.
This error results when the Cast SDK is incorrectly set up. Check the Cast
SDK Setup instructions in section B. again, and try the other method if
your current one doesn't work.
5. My Cast project builds but doesn't run with an "Unable to instantiate
activity ComponentInfo" bug.
This error occurs as a result of previously given erroneous information. If
you've copied the Cast SDK jar into your project's /libs folder, you DO NOT
need to add the jar to your build path. Remove it from the build path and
the project should run as normal.