我花了很多时间将CastVideo-android example on github转换为AndroidStudio项目。
我遇到了这个错误,
Execution failed for task ':chromecast-video:mergeDebugResources'.
/Users/a/AndroidStudioProjects/ChromecastVideoTest/chromecast-video/src/main/res/values/styles_democast.xml:错误:重复资源:/ Users / a / AndroidStudioProjects / ChromecastVideoTest / chromecast-video / src / main / res / values / styles_democast.xml:style / TextAppearance.ShowcaseView.Detail.Light,/ Users / a / AndroidStudioProjects /ChromecastVideoTest / chromecast-video / src / main / res / values / styles_castvideo.xml:style / TextAppearance.ShowcaseView.Detail .Light
根据我在github repo https://github.com/googlecast/CastVideos-android/issues/2上提出的问题的回复,这可能是我的AndroidStudio设置的一个问题...感觉就像构建需要知道要处理的xml样式...
任何人都可以对此有所了解吗?
或者可能建议一种更简单的方法来构建googlecast android演示?
非常感谢。
更新:
好的,这不是一个答案,但它可能暂时帮助某人,直到真正的答案到来...... 最后,我只是手动注释出styles_democast.xml
中的重复定义这是我更新的res / styles / styles_democast.xml
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Democast" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_democast</item>
<item name="popupMenuStyle">@style/PopupMenu.Democast</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Democast</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Democast</item>
<item name="actionDropDownStyle">@style/DropDownNav.Democast</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Democast</item>
<item name="actionModeBackground">@drawable/cab_background_top_democast</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_democast</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Democast</item>
<!-- item name="android:titleTextStyle">@style/WhiteText</item -->
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">@style/Theme.Democast.Widget</item>
<!-- Seekbar -->
<item name="android:seekBarStyle">@style/SeekBarAppTheme</item>
</style>
<!--
style name="WhiteText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@android:color/white</item>
</style
-->
<style name="ActionBar.Solid.Democast" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@drawable/ab_solid_democast</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_democast</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_democast</item>
<item name="progressBarStyle">@style/ProgressBar.Democast</item>
</style>
<style name="ActionBar.Transparent.Democast" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/ab_transparent_democast</item>
<item name="progressBarStyle">@style/ProgressBar.Democast</item>
</style>
<style name="PopupMenu.Democast" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_democast</item>
</style>
<style name="DropDownListView.Democast" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_democast</item>
</style>
<style name="ActionBarTabStyle.Democast" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_democast</item>
</style>
<style name="DropDownNav.Democast" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_democast</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_democast</item>
<item name="android:dropDownSelector">@drawable/selectable_background_democast</item>
</style>
<style name="ProgressBar.Democast" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_democast</item>
</style>
<style name="ActionButton.CloseMode.Democast" parent="@style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_democast</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Democast.Widget" parent="@style/Theme.AppCompat">
<item name="popupMenuStyle">@style/PopupMenu.Democast</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Democast</item>
</style>
<!--
<style name="SeekBarAppTheme" parent="android:Widget.SeekBar">
<item name="android:progressDrawable">@drawable/apptheme_scrubber_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_scrubber_progress_horizontal_holo_light</item>
<item name="android:minHeight">13dip</item>
<item name="android:maxHeight">13dip</item>
<item name="android:thumb">@drawable/apptheme_scrubber_control_selector_holo_light</item>
<item name="android:thumbOffset">16dip</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
</style>
-->
<!-- goes below ... item name="android:actionBarStyle">@style/ActionBar.Transparent.Democastoverlay</item -->
<!--
<style name="Theme.DemocastOverlay" parent="@style/Theme.Democast">
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style>
-->
<!-- goes below .... item name="progressBarStyle">@style/ProgressBar.Democastoverlay</item -->
<!--
<style name="ActionBar.Transparent.Democastoverlay" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/ab_solid_democast</item>
<item name="android:titleTextStyle">@style/WhiteText</item>
</style>
<style name="WhiteText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@android:color/white</item>
</style>
<style name="CastDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowTitleStyle">@style/CastDialogWindowTitle</item>
</style>
-->
<!-- Show Case -->
<!--
<style name="ShowcaseButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">15dp</item>
<item name="android:paddingLeft">35dp</item>
<item name="android:paddingRight">35dp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#000000</item>
<item name="android:background">@color/yellow</item>
</style>
<style name="TextAppearance.ShowcaseView.Title" parent="android:style/TextAppearance.Large">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="TextAppearance.ShowcaseView.Detail" parent="android:style/TextAppearance">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="TextAppearance.ShowcaseView.Detail.Light">
<item name="android:textColor">#666666</item>
<item name="android:shadowColor">#FF0000</item>
<item name="android:shadowRadius">0</item>
</style>
<style name="TextAppearance.ShowcaseView.Title.Light">
<item name="android:shadowRadius">0</item>
</style>
-->
</resources>
更新2:
对CastCompanionLibrary-android error code 138 when compiling
的其他帖子发表了评论这篇文章涉及到github.com/googlecast/CastCompanionLibrary-android编译的问题。 CastCompoionLibrary(CCL)是CastVideos-android的依赖项,所以有些信息可能会帮助那些在Android Studio中难以构建android chromecast示例的人。
答案 0 :(得分:0)
我想这是因为TextAppearance.ShowcaseView.Detail.Light
和styles_democast.xml
styles_castvideo.xml