CastVideos-android 重复资源

Posted

技术标签:

【中文标题】CastVideos-android 重复资源【英文标题】:CastVideos-android Duplicate resources 【发布时间】:2014-02-14 16:34:51 【问题描述】:

我花了很多时间将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 .光

根据对我在 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 进行编译有关的问题。 CastCompanionLibrary (CCL) 作为 CastVideos-android 的依赖项是必需的,因此其中的一些信息可能会帮助任何在 Android Studio 中构建 android chromecast 示例时遇到困难的人。

【问题讨论】:

看看这篇文章和用户在那里做了什么可能与你的情况有关:***.com/questions/21779023/… 呵呵,这是我今天早些时候发的帖子,在 Android Studio 中构建 CastCompanionLibrary-android 非常困难。无论如何感觉我快到了,我可能需要对 Android Studio / gradle 如何处理 android 样式进行更多研究。 如果那是你的帖子,你为什么要发这个??? 另一篇文章都是关于在 Android Studio 中构建 CCL 的问题。这篇文章与 CastVideos-android 相关。它们是不同的问题。如果您仔细阅读另一篇文章,您会意识到最后一个问题是一个红鲱鱼,不知何故,来自 CastVideos-android 的资源最终出现在 CCL 模块中,除其他外......无论如何,我已经用解决方法更新了我的帖子直到找到真正的解决方案。我现在能够构建和运行 CastVideos-android 示例。 【参考方案1】:

我猜是因为你在styles_democast.xmlstyles_castvideo.xml 中都有TextAppearance.ShowcaseView.Detail.Light

【讨论】:

以上是关于CastVideos-android 重复资源的主要内容,如果未能解决你的问题,请参考以下文章

在 CastVideos-android 中与 chromecast 断开连接后恢复手机上的视频

C#以“a”与“an”开头[重复]

C ++中带负数的模数[重复]

442. 找出数组中重复的元素 Find All Duplicates in an ArrayGiven an array of integers

442 Find All Duplicates in an Array 数组中重复的数据

[LeetCode] Find All Duplicates in an Array 找出数组中所有重复项