java.lang.UnsupportedOperationException:无法转换为尺寸:type = 0x1无法启动活动ComponentInfo

时间:2018-10-20 17:00:52

标签: android android-layout

“ java.lang.RuntimeException:无法启动活动ComponentInfo”

我发现了此错误,我的主要活动没有开始, 是什么原因? 错误是

Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
                      at android.content.res.TypedArray.getDimensionPixelOffset(TypedArray.java:533)
                      at android.support.v7.widget.TintTypedArray.getDimensionPixelOffset(TintTypedArray.java:188)
                      at android.support.v7.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:149)
                      at android.support.v7.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:95)
                      at android.support.v7.widget.Toolbar.getWrapper(Toolbar.java:2111)
                      at android.support.v7.widget.ActionBarOverlayLayout.getDecorToolbar(ActionBarOverlayLayout.java:546)
                      at android.support.v7.widget.ActionBarOverlayLayout.pullChildren(ActionBarOverlayLayout.java:538)
                      at android.support.v7.widget.ActionBarOverlayLayout.setWindowCallback(ActionBarOverlayLayout.java:614)
                      at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:410)
                      at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
                      at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                      at com.example.usmanliaqat.urdupoetry.MainActivity.onCreate
  

XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:background="@color/colorPrimaryDark"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:textSize="15pt"
        android:textColor="@color/textcolor"
        android:text="Usman Liaqat"/>
</RelativeLayout>

0 个答案:

没有答案