Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.0 (Preview 3b) layout xml changes not updated in apk?

When I do changes to a layout resource file it's not updated/reflected when the apk file is buildt and installed from Android Studio 2.0 (Preview 3b).

Example: I had a EditText and I added a TextInputLayout like this:

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout_new_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp">

    <EditText
        android:id="@+id/edit_text_new_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/hint_your_new_password"
        android:inputType="textPassword"
        android:saveEnabled="false" />

</android.support.design.widget.TextInputLayout>

The result after updating the app is the same as before I added the TextInputLayout, just the EditText without TextInputLayout.

What I've tried:

  • Build/Clean Project
  • Build/Rebuild Project
  • File/Invalidate Caches / Restart..
  • Uninstall app first
  • Turn off Instant Run

I suspect this is probably a bug with the Preview 3b version of Android Studio 2.0 causing this. Any ideas? Maybe it's just a settings/configuration?

like image 696
TouchBoarder Avatar asked Sep 26 '22 22:09

TouchBoarder


2 Answers

Temporary solution: If you make a copy of the layout file and inflate it instead. Then the changes are updated in the app? But this is not ideally the best solution!

like image 131
TouchBoarder Avatar answered Oct 11 '22 06:10

TouchBoarder


Also make sure you make the changes in the layout-v<target-api> folder if you have set specific layout for specific api level. For example layout-v23 in mine case.

like image 30
SafalFrom2050 Avatar answered Oct 11 '22 05:10

SafalFrom2050