【问题标题】:Android Studio export apk error: Error: Expected resource of type styleable [ResourceType]Android Studio 导出 apk 错误:错误:预期资源类型为 styleable [ResourceType]
【发布时间】:2016-05-07 12:52:25
【问题描述】:

在 android studio 中,当我想生成 signed apk 时,会导致以下错误:

Error:Error: Expected resource of type styleable [ResourceType]

这个类是:https://github.com/astuetz/PagerSlidingTabStrip

我该如何解决这个错误?

PagerSlidingTabStrip类:

https://github.com/astuetz/PagerSlidingTabStrip/blob/master/library/src/com/astuetz/PagerSlidingTabStrip.java

`values/attrs.xml

https://github.com/astuetz/PagerSlidingTabStrip/blob/master/library/res/values/attrs.xml

【问题讨论】:

    标签: android android-studio android-resources


    【解决方案1】:

    如果您正在使用签名的 apk,请使用

    @SuppressWarnings("ResourceType") 抑制警告。解决它。

    【讨论】:

      【解决方案2】:

      搜索“TypedArray”。

      在“TypedArray”所在的类之前添加@SuppressWarnings("ResourceType")。 例如,

       @SuppressWarnings("ResourceType")
          public PagerSlidingTabStrip(Context context, AttributeSet attrs,
                                      int defStyle) {...
      
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-04-06
        • 2016-07-15
        • 2017-06-17
        • 2017-06-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多