Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio shows warning: Element merge is not allowed here

I create custom view based on LinearLayout. Class extends the LinearLayout class, in layout I have:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
    <merge>
        some staff here
    </merge>
</layout>

Android Studio shows the the warning Element merge is not allowed here, but app works.

What's wrong?

like image 516
tse Avatar asked Sep 06 '15 18:09

tse


1 Answers

I believe it's just a glitch in Android studio. Even the official documentation has merge as a direct child of layout: https://developer.android.com/topic/libraries/data-binding/index.html

Edit: I filed a bug there: https://code.google.com/p/android/issues/detail?id=286406&thanks=286406&ts=1490873944

Edit2: Bug is fixed \o/ in AS 3.5 Canary 12

like image 57
mbonnin Avatar answered Oct 16 '22 04:10

mbonnin