Binding Not Found
See original GitHub issueI am getting numerous null pointer exceptions from ButterKnife failing to bind views into Java. I guess the binding might not be being generated? Please can you help me find steps to fix this issue?
From the Logs:
D/ButterKnife: Looking up binding for com.littlesparkshospital.littletrial.activities.MainActivity
D/ButterKnife: Not found. Trying superclass androidx.appcompat.app.AppCompatActivity
XML:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/family_image"
android:layout_toRightOf="@+id/setting_image"
android:id="@+id/map_container">
Java:
@BindView(R.id.map_container)
RelativeLayout mapContainer;
I am using version 10.1.0 of butterknife:
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
It looks like the MainActivity_ViewBinding.java is being generated as I would have expected, so I guess that the library can’t find this generated code at runtime? 😕
// Generated code from Butter Knife. Do not modify!
package com.littlesparkshospital.littletrial.activities;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.annotation.CallSuper;
import androidx.annotation.UiThread;
import butterknife.Unbinder;
import butterknife.internal.DebouncingOnClickListener;
import butterknife.internal.Utils;
import com.littlesparkshospital.littletrial.R;
import java.lang.IllegalStateException;
import java.lang.Override;
public class MainActivity_ViewBinding implements Unbinder {
private MainActivity target;
private View view7f090184;
private View view7f090080;
@UiThread
public MainActivity_ViewBinding(MainActivity target) {
this(target, target.getWindow().getDecorView());
}
@UiThread
public MainActivity_ViewBinding(final MainActivity target, View source) {
this.target = target;
View view;
target.mapContainer = Utils.findRequiredViewAsType(source, R.id.map_container, "field 'mapContainer'", RelativeLayout.class);
view = Utils.findRequiredView(source, R.id.setting_image, "field 'setting_image' and method 'openSettings'");
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Binding not found | SAP Community
Hi Experts, I have configured HTTP_AAE sender and receiver channels;and when I am trying to ping the channel, it says "Binding not found"....
Read more >Synchronization Engine Administrator Role
When binding a Mimecast Synchronization Engine v4 site, the Mimecast credentials for the designated user are required. The designated user ...
Read more >Can't resolve Android databinding class - Stack Overflow
I found solution with ContentMainBinding class name for data binding. Lets me explain. ... I've cleaned the project , Rebuild was done...but of...
Read more >Binding: Property not found - Microsoft Q&A
Hi,. Complete beginner here! I am trying to create a simple ListView using Mvvmhelpers and I am having trouble with data binding.
Read more >3 Methods for Solving Android Data Binding Errors - Atomic Spin
Getting cryptic data binding errors like "error: cannot find symbol import" in Android? Here are some methods to help you figure out what's ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same problem, any solution?