Fatal Exception: java.lang.NoSuchMethodError with Android Chat V2 and Zendesk 5.0.0
I`m getting the following error whenever I try to open the Chat Activity :
Fatal Exception: java.lang.NoSuchMethodError
No direct method <init>(Ljava/lang/String;Ljava/lang/Boolean;Lzendesk/messaging/AttachmentSettings;)V in class Lzendesk/messaging/Update$State$UpdateInputFieldState; or its super classes (declaration of 'zendesk.messaging.Update$State$UpdateInputFieldState' appears in /data/app/br.com.ampli-1/base.apk:classes2.dex)
This started happening when I updated to 5.0.0 version, and I can't find any solution, I need to change the chat activity to a request activity to stop crashing, hope you guys can give me some light on it.
I tried all solutions from this topic, but any of them worked:
https://support.zendesk.com/hc/en-us/community/posts/360048337953-SDK-V2-Android-error-NoSuchMethodError?input_string=Fatal%20Exception%3A%20java.lang.NoSuchMethodError%20when%20Android%20Chat
This is how I initialize Zendesk:
zendesk.chat.TextField.getInputFieldState (TextField.java)
zendesk.messaging.Update$State$UpdateInputFieldState.updateHint (Update.java)
zendesk.chat.ChatFormDriver.updateWithMessagingItems (ChatFormDriver.java:2)
zendesk.chat.ChatFormDriver.next (ChatFormDriver.java:12)
zendesk.chat.ChatFormDriver.driveOfflineFormCollection (ChatFormDriver.java:2)
zendesk.chat.ChatFormStage.onAgentUnavailable (ChatFormStage.java:10)
zendesk.chat.ChatAgentAvailabilityStage$1.update (ChatAgentAvailabilityStage.java)
zendesk.chat.ChatAgentAvailabilityStage$1.update (ChatAgentAvailabilityStage.java)
zendesk.chat.ObservableData.notifyObservers (ObservableData.java)
zendesk.chat.ObservableData.observe (ObservableData.java)
zendesk.chat.ZendeskAccountProvider.observeAccount (ZendeskAccountProvider.java)
zendesk.chat.ChatAgentAvailabilityStage.onChatInit (ChatAgentAvailabilityStage.java)
zendesk.chat.ChatStatusCheckStage.processUpdate (ChatStatusCheckStage.java:5)
zendesk.chat.ChatStatusCheckStage.access$000 (ChatStatusCheckStage.java)
zendesk.chat.ChatStatusCheckStage$1.update (ChatStatusCheckStage.java)
zendesk.chat.ChatStatusCheckStage$1.update (ChatStatusCheckStage.java)
zendesk.chat.ObservableData.notifyObservers (ObservableData.java)
zendesk.chat.ObservableData.setData (ObservableData.java)
zendesk.chat.ZendeskConnectionProvider$1.update (ZendeskConnectionProvider.java)
zendesk.chat.ZendeskConnectionProvider$1.update (ZendeskConnectionProvider.java)
zendesk.chat.MainThreadPoster$1$1.run (MainThreadPoster.java)
android.os.Handler.handleCallback (Handler.java:751)
This started happening when I updated to 5.0.0 version, and I can't find any solution, I need to change the chat activity to a request activity to stop crashing, hope you guys can give me some light on it.
I tried all solutions from this topic, but any of them worked:
https://support.zendesk.com/hc/en-us/community/posts/360048337953-SDK-V2-Android-error-NoSuchMethodError?input_string=Fatal%20Exception%3A%20java.lang.NoSuchMethodError%20when%20Android%20Chat
This is how I initialize Zendesk:
Zendesk.INSTANCE.init(
this,
getString(R.string.zendesk_url),
getString(R.string.zendesk_app_id),
getString(R.string.zendesk_client_id)
)
Support.INSTANCE.init(Zendesk.INSTANCE)
Zendesk.INSTANCE.setIdentity(
AnonymousIdentity.Builder().withNameIdentifier(
getString(R.string.zendesk_chat_name_identifier)
).withEmailIdentifier(
null
).build()
)
Chat.INSTANCE.init(context, getString(R.string.zendesk_account_key))
And this is how I started the chat activity:
fun startChatV2() {
val chatConfiguration = ChatConfiguration.builder().withNameFieldStatus(PreChatFormFieldStatus.REQUIRED)
.withEmailFieldStatus(PreChatFormFieldStatus.REQUIRED).withPhoneFieldStatus(PreChatFormFieldStatus.REQUIRED)
.withAgentAvailabilityEnabled(true).withPreChatFormEnabled(true).build()
val profileProvider = Chat.INSTANCE.providers()!!.profileProvider()
val visitorInfo = VisitorInfo.builder().withName(student).build()
profileProvider.setVisitorInfo(visitorInfo, null)
MessagingActivity.builder().withEngines(ChatEngine.engine()).show(context, chatConfiguration)
}
-
Hey Julio,
Thanks for taking the time to share this with us! Are you still receiving this error on your end? If so, I'll need to generate a ticket on your behalf so our Customer Care team can look into this further.
Let me know!
Please sign in to leave a comment.
1 Comments