83

Android Studio 3.6

in app/build.gradle:

android {
viewBinding.enabled = true

Here my xml:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/bluetoothBottonMainContainer"
        android:layout_width="0dp"
        android:layout_height="104dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <View
            android:id="@+id/viewPointNotSelect"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:background="@drawable/circle_transparent"
            app:layout_constraintBottom_toBottomOf="@+id/separator"
            app:layout_constraintEnd_toStartOf="@+id/separator"
app:layout_constraintTop_toTopOf="parent" />

and another xml the unclude prev. xml:

 <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/bottonContainer"
        android:layout_width="0dp"
        android:layout_height="104dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <include
            android:id="@+id/qrBottonContainer"
            layout="@layout/qr_bottom_container"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent" />

here my activity:

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = QrBluetoothSwipeActivityBinding.inflate(layoutInflater)
        setContentView(binding.root)
}

the app is build and run. Nice.

Now I move id - android:id="@+id/bluetoothBottonMainContainer"

to outer container like this:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/bluetoothBottonMainContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="0dp"
        android:layout_height="104dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <View
            android:id="@+id/viewPointNotSelect"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:background="@drawable/circle_transparent"
            app:layout_constraintBottom_toBottomOf="@+id/separator"
            app:layout_constraintEnd_toStartOf="@+id/separator"
            app:layout_constraintTop_toTopOf="parent" />

app is build, but when run I get runtime error in this line:

binding = QrBluetoothSwipeActivityBinding.inflate(layoutInflater)

error:

10-25 11:11:51.290 E/AndroidRuntime(14128): FATAL EXCEPTION: main
10-25 11:11:51.290 E/AndroidRuntime(14128): Process: com.myproject.debug, PID: 14128
10-25 11:11:51.290 E/AndroidRuntime(14128): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myproject.debug/com.myproject.ui.actviity.QRBluetoothSwipeActivity}: java.lang.NullPointerException: Missing required view with ID: bluetoothBottonMainContainer
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.os.Handler.dispatchMessage(Handler.java:102)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.os.Looper.loop(Looper.java:148)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread.main(ActivityThread.java:5417)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at java.lang.reflect.Method.invoke(Native Method)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-25 11:11:51.290 E/AndroidRuntime(14128): Caused by: java.lang.NullPointerException: Missing required view with ID: bluetoothBottonMainContainer
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.myproject.databinding.BluetoothBottomContainerBinding.bind(BluetoothBottomContainerBinding.java:114)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.myproject.databinding.QrBluetoothSwipeActivityBinding.bind(QrBluetoothSwipeActivityBinding.java:76)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.myproject.databinding.QrBluetoothSwipeActivityBinding.inflate(QrBluetoothSwipeActivityBinding.java:62)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.myproject.databinding.QrBluetoothSwipeActivityBinding.inflate(QrBluetoothSwipeActivityBinding.java:52)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at com.myproject.ui.actviity.QRBluetoothSwipeActivity.onCreate(QRBluetoothSwipeActivity.kt:31)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.Activity.performCreate(Activity.java:6251)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-25 11:11:51.290 E/AndroidRuntime(14128):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-25 11:11:51.290 E/AndroidRuntime(14128):     ... 9 more
10-25 11:11:51.291 W/ActivityManager(  780):   Force finishing activity com.myproject.debug/com.myproject.ui.actviity.QRBluetoothSwipeActivity
10-25 11:11:51.307 I/Icing   (11529): Indexing done com.google.android.gms-apps
Molly
  • 1,887
  • 3
  • 17
  • 34
Alexei
  • 14,350
  • 37
  • 121
  • 240
  • 4
    Renaming the id of the view which was producing a NPE worked for me. Went from drawerLayout to drawerLayout_main and this resolved my issue. – 11m0 Dec 24 '19 at 23:00
  • 10
    Hi while working with merge tags you need to extra careful, I have written a blog post completely explaining view binding. and why merge tag doesnt work so easily, checkout [Androidbites|ViewBinding](https://chetangupta.net/viewbinding/) – Chetan Gupta Dec 06 '20 at 10:55
  • @11m0 please create an answer so that I can upvote it. This is the ONLY answer which worked for us! – MidasLefko Feb 21 '21 at 15:22

32 Answers32

82

If someone is getting this with TabLayout and ViewBinding enabled then you might have set id for the TabItem. Removing id from TabItem rseolved the issue for me.

Update: For those people wondering how they can switch tabs without having an id and a ViewPager2, here is the documentation that recommends using TabLayoutMediator:

Create swipe views with tabs using ViewPager2

minato
  • 2,028
  • 1
  • 18
  • 30
68

Please check, maybe you have the same layout files in different modules.

Maxim Firsoff
  • 2,038
  • 22
  • 28
52

I encountered this issue but in my case the issue is the include flag. The workaround I found is to make the view id to be the same as the id of the root view of the included layout.

activity_layout.xml

<LinearLayout>
    <include android:id="@+id/widget1" layout="@layout/my_widget" />
</LinearLayout>

my_widget.xml

<LinearLayout
    android:id="@+id/widget1">
</LinearLayout>
Arst
  • 3,098
  • 1
  • 35
  • 42
43

Watch out, if you use <merge> inside your included layout XML, the logic is different, as pointed out here:
Exploring Android View Binding in Depth

If we try to give this an ID, the view binding won’t generate the ID in the binding class so we can’t access the view as we did in the case of the normal include.
In this case, we have PlaceholderBinding which is an auto-generated class for placeholder.xml (our <merge> layout file). We have to call its bind() method and pass the root view of the layout in which we included it.

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<include layout="@layout/placeholder" />

</androidx.constraintlayout.widget.ConstraintLayout>
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
        binding = FragmentOrderBinding.inflate(layoutInflater, container, false)
        placeholderBinding = PlaceholderBinding.bind(binding.root)
        placeholderBinding.tvPlaceholder.text = getString(R.string.please_wait)
        return binding.root
    }
Big_Chair
  • 2,781
  • 3
  • 31
  • 58
22

Update

This should be fixed in latest Beta, Carnary versions of Android Studio

Still there is an issue when using View Binding with material tab layout tab items which is reported here and have not fixed yet.


This is bug in ViewBinding which is reported in the issue tracker in following places.

user158
  • 12,852
  • 7
  • 62
  • 94
  • 27
    Status fixed? Of course not. I still have this issue. – Paradoxy Feb 25 '20 at 14:28
  • @Paradoxy it should works now, upgrade your Android studio to latest version, since viewbinding is coming from build tools in Android Studio – user158 Feb 26 '20 at 13:01
  • 3
    I am using android studio 3.6 from 12/2/2020 and yet the problem didn't go away for some of my activities. I have a linearLayout, which has tabLayout, viewPager, etc as its childs. My tabLayout itself has 3 tab items. I get Missing required view with ID for tab items. When I remove their id, this error goes away. I am using simple ids such as @id/tabitem, etc. This activity also has a drawerlayout with navigation. By using viewbinding, its toggle disappears even though I call .setDisplayHomeAsUpEnabled(true).In the end I added tools:viewBindingIgnore="true" and used that good old findviewbyid. – Paradoxy Feb 26 '20 at 13:46
  • 1
    @Paradoxy I also faced this issue, it is [already reported](https://issuetracker.google.com/issues/145687658) which is not fixed. – user158 Feb 26 '20 at 13:58
  • 4
    The error still occurred to me, when using `` layout for dynamically added view, e.g: `parent_layout.xml` -> addView for `parent_layout.xml` child using `MyMergeLayoutBinding.inflate(inflater, viewGroup, false)` -> `my_merge_layout.xml` is using `` as parent tag – mochadwi Mar 03 '20 at 03:09
  • the above 3 issue also occurred to me – mochadwi Mar 03 '20 at 03:57
  • 2
    Still an issue today with AS v3.6.1 and AGP v3.6.1. – Erik Mar 03 '20 at 14:30
  • @Erik earlier mentioned issues are fixed for me in the canary. – user158 Mar 04 '20 at 01:48
  • would you mind giving us information which version of canary, that this problem is fixed? @user158 – mochadwi Mar 05 '20 at 07:44
  • @mochadwi I used AS 4.0 canary 9, should be also fixed on latest versions like 4.1 canary 1 – user158 Mar 05 '20 at 14:37
  • I got this when I had an include which was referring to a layout with just Toolbar in the layout as the root. – Udayaditya Barua Mar 26 '20 at 14:11
  • In my experience, this will also happen when you try to mix simple ViewBinding with DataBinding layouts (if only some of your layouts involved have the `layout` root). – mkuech Mar 31 '20 at 22:45
  • Done. This fails: Android Studio 3.6.2 - This works: Android Studio 4.1 Canary 5 – zgluis Apr 14 '20 at 16:01
  • 3
    Still happening for me in 4.0.1 (Main Rlease) – paul_f Jul 31 '20 at 16:10
  • Seems like still exist in AS 2022.1.1 – rminaj Feb 18 '23 at 09:35
10

You can also get this error if you incorrectly bind a cell to a view in a recyclerView. If you bind a view to the wrong layout, then you will get an error stating that it cannot find the expect child views.

This had me stumped for a long time.

The solution is to ensure the layout you are binding to the view is the same layout as the ViewBinding.

For example, makesure:

R.layout.my_new_view

is bound to:

MyNewViewBinding

Or you will get this error.

paul_f
  • 1,296
  • 17
  • 20
10

You should delete the TabItem id and use the TabLayout API to get the item, this workaround works if you are using Material Design

check this: Github answer

Dreft
  • 101
  • 1
  • 3
4

In my case, there was another file with the same name in another module.

I had item_view.xml in module A and item_view.xml in module B, so databinding couldn’t distinguish between them.

I changed the name of one of them and it fixed.

FarshidABZ
  • 3,860
  • 4
  • 32
  • 63
  • same for me; my problem was also with data binding. I copied and pasted the layout code because I had two similar layouts, but I forgot to associate the second layout with its viewmodel. It remained associated with the other viewmodel and the variables had different names, so the binding crashed, showing "Missing required view with ID:" – Daniel Cettour Nov 15 '22 at 12:24
3

The solution is remove the id of the main container. And put in other container inside the parent.

1.- Layout

    <include
    android:id="@+id/example"
    layout="@layout/account_current_payment_card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>
    

2.- Include Layout

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/example2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent">
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
DavidUps
  • 366
  • 3
  • 9
3

This is happening to me right now. I just noticed that this happened because in my xml files lets call them: Activity_main.xml / Activity_other.xml I used to have a widget (a button in this case) with the same id, (+id/bttNext)

(that means activity_main.xml and Activity_other used to have a button with the same +id)

as soon I test my app on a device the:

java.lang.NullPointerException: Missing required view with ID:

appeared

as soon I changed the second activity´s button´s +id (let's say renamed bttNext1) the app worked fine

To summarize: avoid using the same id in buttons (et al widgets) does not matter if they´re in separate activities

Jaydeep parmar
  • 561
  • 2
  • 15
MarkT
  • 378
  • 2
  • 7
2

In my case , I removed the id inside the included layout and it works properly !

main.xml

    <RelativeLayout>   
    ....
    <include
        include="@layout/included_layout"   
        android:id="@+id/view_included_layout"/>
    </RelativeLayout>

included_layout.xml

`   <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/top_level_layout">  <!-- Remove this id -->    
        ....
    </LinearLayout>
`

My Android Studio version is 3.6.2 and version of build.gradle is 3.6.1

adi
  • 984
  • 15
  • 33
  • this also works for me. turns out the id inside included layout not found if we configure id on both `` tag or the parent layout used – mochadwi Jun 13 '20 at 12:24
2

I tried many ways, but all didn't work.

Finally, the problem is there is an XML with the same name in another module

Jichen Dai
  • 21
  • 1
1

I meet the same bug.You can add a wrapper view in your "outer container" to avoid this bug.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/bluetoothBottonMainContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="0dp"
        android:layout_height="104dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <View
            android:id="@+id/viewPointNotSelect"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:background="@drawable/circle_transparent"
            app:layout_constraintBottom_toBottomOf="@+id/separator"
            app:layout_constraintEnd_toStartOf="@+id/separator"
            app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

ZX C
  • 17
  • 1
1

For me, the issue was that I was still using Android 3.x version, but was using the new Gradle 4.0.0 version.

Pressed "About->Check for Updates", updated Android Studio, and the error is no more.

Starwave
  • 2,352
  • 2
  • 23
  • 30
1

just remove .gradle directory and invlidate caches/restart the project, keep backup of project. I was facing the same issue, solved using this method.

1

This is error can also happen if you by mistake use an xml layout for the fragment but use a different one for the binding.I was doing when I encountered the error

class LoginFragment :Fragment(R.layout.login_fragment) { 
private val binding by viewBinding(LoginFragmentNewBinding::bind)//here I am referring to a new xml file called login_fragment_new which is different from the one in the Fragment's constructor (i.e login_fragment)
}

and using the same xml file fixed it for me.

Mohammed Fathi
  • 1,237
  • 1
  • 14
  • 12
1

Got this issue with custom view , where is wrongly took this instead of super

constructor(context: Context, attrs: AttributeSet?) : this(context,attrs) { //<-Change this to super

}
Manohar
  • 22,116
  • 9
  • 108
  • 144
1

I was getting error because in my case main app and module has same layout (layout_calling_waiting) with different views which was not able to find in app's layout. So the error waas giving.

AndyBoy
  • 564
  • 6
  • 29
1

i faced same problem and i solved it by remove this line in the layout.

tools:context=".ui.SplashScreenActivity
kubranur
  • 11
  • 3
  • 1
    tools:context doesn't matter when an app runs, maybe it was indirectly because after removing this you triggered builds/cleans that needed to happen. – David Mar 07 '23 at 12:01
1

In my case this problem was related with same naming of xml files in different modules.

Why got problem:

I had 2 xml files with the same name (item_tag.xml) in different modules (app, landing). Compiler doesn't know which one need to use, and I got an error during runtime (every time when I opened a screen with this binding).

Solution:

I renamed xml file, and one become item_landing_tag.xml (and got generated ItemLandingTagBinding class instead of ItemTagBinding).

Hope it helps someone :)

SerjantArbuz
  • 982
  • 1
  • 12
  • 16
  • 1
    I faced this problem too. Had a common dialog which was in 'app' then i moved to 'ui' . Instead of moving the layout files, i copy pasted them and caused this crash because now it existed in 2 modules. – Udayaditya Barua Feb 16 '23 at 11:22
0

My solution was similar but slightly different, I had an include in my dialog

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:minHeight="@dimen/complete_programme_min_height"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<include
    android:id="@+id/include" <!-- Removing this line worked -->
    layout="@layout/background_triangle_medium_violet_gradient" />
Pang
  • 9,564
  • 146
  • 81
  • 122
juliusspencer
  • 3,008
  • 3
  • 26
  • 30
0

getRootView() returns the included layout and can make changes in it

0

It may be late but. For everyone who come across this issue. I first tried out everything I saw here with no luck. I found out that using snake case ids fixes the problem. I had an id as tabContainer annd it was causing the NPE. Renaming it to tab_container fixed the bug for me.

Espera Awo
  • 40
  • 5
0

Same problem but just in custom view activity I put the correct attributes.

In kotlin:

class CanvasNew @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null):View(context,attrs){

Edwin Paz ss. -
  • 177
  • 2
  • 5
0

For my base my_main_layout.xml was -

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

  <ScrollView style="@style/ScrollViewContainerStyle">

    <include
        android:id="@+id/include_1"
        layout="@layout/layout"></include>
    
    <include
        android:id="@+id/include_1"
        layout="@layout/layout"></include>
    
    <include
        android:id="@+id/include_1"
        layout="@layout/layout"></include>
    </include></layout>

 </ScrollView>

And my included layout.xml was -

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
    android:id="@+id/tv_title"
    tools:text="This is a tile" />
</LinearLayout>

I just solved my problem by wrapping it with <layout> -

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:visibility="visible">
<TextView
    android:id="@+id/tv_title"
    tools:text="This is a tile" />
</LinearLayout>
</layout>
Gk Mohammad Emon
  • 6,084
  • 3
  • 42
  • 42
0

In my case I was using incorrect FragmentBinding class in onCreateView method to inflate layout:

open class InfoFragment : BaseFragment() {

    private val binding by viewBinding(FragmentInfoBinding::bind)
    
    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
        // NOTE: using incorrect binding class
        return FragmentEducationBinding.inflate(inflater, container, false).root
    }
    ...
}

To solve this issue I should have to use the correct binding class in onCreateView method, FragmentInfoBinding in my case:

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
    return FragmentInfoBinding.inflate(inflater, container, false).root
}
Sergio
  • 27,326
  • 8
  • 128
  • 149
0

A solution could be:

init {
    id = context.obtainStyledAttributes(attrs, intArrayOf(android.R.attr.id)).let { typedArray ->
        val value = typedArray.getResourceId(0, View.NO_ID)
        typedArray.recycle()
        value
    }
    val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
    binding = AnyBinding.inflate(inflater, this)
}
0

enter image description here

Run your code with opposite { minifyEnabled }

If so now:

debug {
      minifyEnabled false
}

Then run so:

debug {
      minifyEnabled true
}

Or vice versa.

Pang
  • 9,564
  • 146
  • 81
  • 122
0

Solved it by using: Invalidate Caches and Clean Project.
In my case I copied some widgets from one layout to another and after that I changed the ids (so no ids were repeated).
Debug build worked correctly, but when trying to run a release build the Exception was thrown.

MatJB
  • 106
  • 2
  • 8
0

Cleaning and Rebuilding project helped me

0

I had this problem too, but apparently it was exactly what the error pointed out, a null pointer, the view got "consumed" by my custom view container that only accepted first child view after infaltion and the next view with the ID pointed out by the error was removed from hierarchy so the viewbinder could not bind them.

Sagan
  • 112
  • 1
  • 7
0

I had different layouts for phones and tablets, and the view id was missing in one of the layouts, adding it solved the problem.

In src/main/res/layout-sw600dp/fragment_satellite.xml I had the view:

....
<FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="@dimen/row005"
        />
....

but in src/main/res/layout/fragment_satellite.xml there wasn't a view with the same id @+id/container, so adding it to src/main/res/layout/fragment_satellite.xml solved the problem.

Sergio
  • 27,326
  • 8
  • 128
  • 149