访问被拒绝找到属性“ ro.sf.lcd_density”

时间:2019-08-26 07:06:59

标签: java android android-studio

我的程序正在正确运行,但是此错误正在编译器中显示。如何解决?

我检查了很多次,对此没有答案。

activity_main

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:id="@+id/mainLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <!-- username-->
    <com.google.android.material.textfield.TextInputLayout

        android:id="@+id/username_TIL"
        android:layout_width="250dp"
        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"
        android:layout_marginTop="100dp"
        android:elevation="2dp">

        <com.google.android.material.textfield.TextInputEditText

            android:id="@+id/username_TIET"
            android:layout_width="match_parent"
            android:layout_height="match_parent"

            android:hint="@string/username" />

    </com.google.android.material.textfield.TextInputLayout>
    <!-- password-->
    <com.google.android.material.textfield.TextInputLayout

        android:id="@+id/password_TIL"
        android:layout_width="250dp"
        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:layout_below="@id/username_TIL">

        <com.google.android.material.textfield.TextInputEditText

            android:id="@+id/password_TIET"
            android:layout_width="match_parent"
            android:layout_height="match_parent"

            android:hint="password"/>

    </com.google.android.material.textfield.TextInputLayout>
    <!-- confirmPassword-->
    <com.google.android.material.textfield.TextInputLayout

        android:id="@+id/confirmPassword_TIL"
        android:layout_width="250dp"
        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:layout_below="@id/password_TIL">

        <com.google.android.material.textfield.TextInputEditText

            android:id="@+id/confirmPassword_TIET"
            android:layout_width="match_parent"
            android:layout_height="match_parent"

            android:hint="@string/confirm_password"/>

    </com.google.android.material.textfield.TextInputLayout>
    <!-- SignIn-->
    <androidx.appcompat.widget.AppCompatButton

        android:id="@+id/signIn_BTN"
        android:layout_width="100dp"
        android:layout_height="wrap_content"

        android:text="@string/sign_in"
        android:textColor="@android:color/white"
        app:cornerRadius="50dp"
        android:elevation="2dp"
        android:layout_below="@id/confirmPassword_TIL"
        android:layout_marginTop="20dp"
        android:layout_centerHorizontal="true"
        android:background="@android:color/holo_blue_light"/>

</RelativeLayout>

MainActivity中没有任何内容-已初始化

清单文件也没有添加任何额外内容。关于为什么会发生此错误的任何解释。另外还会显示一个错误。

E/InputTransport: ro.sf.lcd_density must be defined as a build property

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,但是我的原因是屏幕密度高。您可能需要修改可绘制文件夹中的图像或图标大小(如果有),然后生成一个副本到以下目录。

let obj: T = { foo: "foo", xyz: "xyz" } as T
console.log(obj.foo); // type error

有关更多信息,请阅读here