google-developer-training / android-basics-kotlin-mars-photos-app

Apache License 2.0
92 stars 193 forks source link

RecyclerView Null pointer Exception -Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter #171

Closed pravinmohol closed 10 months ago

pravinmohol commented 1 year ago

Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter data at com.example.marshphotosapp.BindingAdaptersKt.bindRecyclerView(Unknown Source:7) at com.example.marshphotosapp.databinding.FragmentOverviewBindingImpl.executeBindings(FragmentOverviewBindingImpl.java:160) at androidx.databinding.ViewDataBinding.executeBindingsInternal(ViewDataBinding.java:512) at androidx.databinding.ViewDataBinding.executePendingBindings(ViewDataBinding.java:484) at androidx.databinding.ViewDataBinding$OnStartListener.onStart(ViewDataBinding.java:1706) at java.lang.reflect.Method.invoke(Native Method) at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:222) at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:199)  at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:190)  at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:40)  at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)  at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:271)  at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:313)  at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)  at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)  at androidx.fragment.app.Fragment.performStart(Fragment.java:3167)  at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:588)  at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:279)  at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)  at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1433)  at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2977)  at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2902)  at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:274)  at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:359)  at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1467)  at android.app.Activity.performStart(Activity.java:8079)  at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3710)  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)  at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7842)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)  I/Process: Sending signal. PID: 8239 SIG: 9

pravinmohol commented 1 year ago

Can you please advise where its going wrong ?. I see BidningAdapters class has bindRecyclerView function which has recyclerview as a parameter and causing null pointer here.