[Problem/Question]
- So after our App was rejected because request permission
android.permission.REQUEST_INSTALL_PACKAGES
which is used by senbird under version 3.1.0 so we decide to migrate to version 3.1.1, but when doing migration we found crash on ChannelActivity, we dont use any mention but the error show MentionEditText, i still dont know what happen
E/SBUIKIT: [14:51:02.901 MessageInputView:<init>():199] java.lang.ClassCastException: androidx.appcompat.widget.AppCompatEditText cannot be cast to com.sendbird.uikit.widgets.MentionEditText
at com.sendbird.uikit.databinding.SbViewMessageInputBinding.bind(SbViewMessageInputBinding.java:148)
at com.sendbird.uikit.databinding.SbViewMessageInputBinding.inflate(SbViewMessageInputBinding.java:120)
at com.sendbird.uikit.widgets.MessageInputView.<init>(MessageInputView.java:92)
at com.sendbird.uikit.modules.components.MessageInputComponent.onCreateView(MessageInputComponent.java:126)
at com.sendbird.uikit.modules.ChannelModule.onCreateView(ChannelModule.java:115)
at com.sendbird.uikit.fragments.BaseModuleFragment.onCreateView(BaseModuleFragment.java:62)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2995)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:523)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2849)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2784)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:262)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:478)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)
at android.app.Activity.performStart(Activity.java:8188)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3576)
at android.app.servertransaction.TransactionExecutor.
E/SBUIKIT: Cont(1) 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:2146)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8057)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lionparcel.services.driver.stage, PID: 15275
java.lang.NullPointerException: Attempt to read from field 'com.sendbird.uikit.widgets.MentionEditText com.sendbird.uikit.databinding.SbViewMessageInputBinding.etInputText' on a null object reference
at com.sendbird.uikit.widgets.MessageInputView.getInputEditText(MessageInputView.java:390)
at com.sendbird.uikit.modules.components.MessageInputComponent.onCreateView(MessageInputComponent.java:142)
at com.sendbird.uikit.modules.ChannelModule.onCreateView(ChannelModule.java:115)
at com.sendbird.uikit.fragments.BaseModuleFragment.onCreateView(BaseModuleFragment.java:62)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2995)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:523)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2849)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2784)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:262)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:478)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)
at android.app.Activity.performStart(Activity.java:8188)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3576)
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:2146)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8057)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
// If problem, please fill out the below. If question, please delete.
[UIKit Version]
// What version of the SDK are you using?
[Reproduction Steps]
// Already Open ChannelListActivity and show list channel , when want action
setOnItemClickListener { _, _, channel -> showCustomChannelActivity(channel.url) }
on
override fun createFragment(): ChannelListFragment {
return ChannelListFragment.Builder(R.style.SendBird_Custom)
.setUseHeader(true)
.setHeaderTitle(getString(R.string.chat_customer))
.setUseHeaderRightButton(true)
.setHeaderLeftButtonIconResId(R.drawable.ics_o_arrow_left_alt)
.setHeaderRightButtonIconResId(R.drawable.ics_o_setting)
.setOnHeaderRightButtonClickListener { goToSettings() }
.setOnItemClickListener { _, _, channel → showCustomChannelActivity(channel.url) }
.setOnItemLongClickListener { _, _, _ → }
.build()
}
Apps will crash and return error log :
java.lang.NullPointerException: Attempt to read from field 'com.sendbird.uikit.widgets.MentionEditText com.sendbird.uikit.databinding.SbViewMessageInputBinding.etInputText' on a null object reference
[Frequency]
// How frequently is this issue occurring?
- When Migration from 2.2.0 to 3.1.1
[Current impact]
// How is this currently impacting your implementation?
- Can’t Access Channel Fragment