Couldn't resolve resource @id/visible when using TextInputLayout

AndroidAndroid StudioAndroid Textinputlayout

Android Problem Overview


Couldn't resolve resource @id/visible when using TextInputLayout on appcompat-v7:25.x.x

Tried these steps below, but the problem is still persist:

  1. Rebuild Project
  2. Clean and Rebuild Project
  3. Clear Cache and Restart Android Studio

Below is the code in the layout file.

    <android.support.design.widget.TextInputLayout
            android:id="@+id/tilFirstName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.design.widget.TextInputEditText
                android:id="@+id/etFirstName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/first_name"
                android:inputType="textPersonName"/>
    </android.support.design.widget.TextInputLayout>

Below is the message displayed in Android Studio

> Rendering Problems. > > Couldn't resolve resource @id/visible > > Tip: Try to refresh the layout.

NOTE: @id/visible is not present in the code.

Android Solutions


Solution 1 - Android

This nags one with the Rendering Problems window

How to fix: add these values to any values file (the filename doesn't appear to matter, I use ids.xml, you can use an existing one as well, such as colors.xml or strings.xml)

<?xml version="1.0" encoding="utf-8"?>
<resources>
	<item name="visible" type="id"/>
	<item name="masked" type="id"/>
</resources>

Solution 2 - Android

It most likely is a bug, and it has been filed in the Issue Tracker.

Meanwhile, you may try to switch the API version in the editor to 19 or below, though you may see some minor differences in the design output.

Solution 3 - Android

No Need To Change API

Couldn't resolve resource @string/faq_customer_service

or

Couldn't resolve resource @id/visible

or

Couldn't resolve resource @id/masked

The solution is if you implement TextInputLayout the above problems may arise ... so Simply add those id or strings to xml files as their property.

Solution 4 - Android

Add the value below tag in strings.xml file:

 <item name="visible" type="id"/>
 <item name="masked" type="id"/>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFanFMView Question on Stackoverflow
Solution 1 - AndroidShujitoView Answer on Stackoverflow
Solution 2 - Androiduser5404864View Answer on Stackoverflow
Solution 3 - Androidkeshav mainaliView Answer on Stackoverflow
Solution 4 - AndroidSumant SinghView Answer on Stackoverflow