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

When I make changes to the layout resource file, it is not updated / not reflected when the apk file is embedded and installed from Android Studio 2.0 (Preview 3b).

Example: I had an EditText , and I added a TextInputLayout as follows:

 <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 application is the same as before I added TextInputLayout , just EditText without TextInputLayout .

What I tried:

  • Assembly / cleaning project
  • Build / rebuild project
  • File / Invalid Cache / Restart ..
  • Uninstall the application first.
  • Disable Instant Launch

I suspect this is probably a bug in version 3b for Android version 2.0 causing this. Any ideas? Maybe it's just settings / configurations?

+5
source share
4 answers

Workaround: If you make a copy of the layout file and inflate it. Then the changes are updated in the application? But this is not an ideal solution!

+2
source

This problem is usually caused only by updating the xml file in one layout folder, and not with other folders containing file compatibility options. For example, only editing the xml file in the layout system folder, and not the layout-v14 folder, will also cause this problem.

Bugfix: update the instance of the XML layout file not only in the layout folder, but also in all other layout folders (layout-v14, layout v-21, etc.)

+1
source

Also make sure that you make changes to the layout-v<target-api> folder if you set a specific layout for a specific api level. For example, layout-v23 in my case.

+1
source

I could not reproduce this problem. I tried the same layout changes with Preview 3b, and the changes appeared in the emulator. I just pressed the start button again.

Did this work for you in a previous version of Android Studio?

0
source

Source: https://habr.com/ru/post/1238352/


All Articles