SDK V2 Android error NoSuchMethodError
Hello,
I use Chat v2 SDK for Android, because I need a feature attach file pdf, but when enter the chat activity, I get an error like this :
Stack trace:
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/com.myapp.android-1/base.apk:classes5.dex)
at zendesk.chat.TextField.getInputFieldState(TextField.java:111)
at zendesk.chat.Form.getNextInputFieldState(Form.java:117)
at zendesk.chat.ChatFormDriver.updateWithMessagingItems(ChatFormDriver.java:237)
at zendesk.chat.ChatFormDriver.next(ChatFormDriver.java:213)
at zendesk.chat.ChatFormDriver.drivePreChatFormCollection(ChatFormDriver.java:108)
at zendesk.chat.ChatFormStage.onAgentAvailable(ChatFormStage.java:110)
at zendesk.chat.ChatAgentAvailabilityStage$1.update(ChatAgentAvailabilityStage.java:68)
at zendesk.chat.ChatAgentAvailabilityStage$1.update(ChatAgentAvailabilityStage.java:61)
at zendesk.chat.ObservableData.notifyObservers(ObservableData.java:175)
at zendesk.chat.ObservableData.observe(ObservableData.java:105)
at zendesk.chat.ZendeskAccountProvider.observeAccount(ZendeskAccountProvider.java:51)
at zendesk.chat.ChatAgentAvailabilityStage.onChatInit(ChatAgentAvailabilityStage.java:61)
at zendesk.chat.ChatStatusCheckStage.processUpdate(ChatStatusCheckStage.java:132)
at zendesk.chat.ChatStatusCheckStage.access$000(ChatStatusCheckStage.java:23)
at zendesk.chat.ChatStatusCheckStage$1.update(ChatStatusCheckStage.java:83)
at zendesk.chat.ChatStatusCheckStage$1.update(ChatStatusCheckStage.java:80)
at zendesk.chat.ObservableData.notifyObservers(ObservableData.java:175)
at zendesk.chat.ObservableData.setData(ObservableData.java:161)
at zendesk.chat.ZendeskConnectionProvider$1.update(ZendeskConnectionProvider.java:64)
at zendesk.chat.ZendeskConnectionProvider$1.update(ZendeskConnectionProvider.java:61)
at zendesk.chat.MainThreadPoster$1$1.run(MainThreadPoster.java:38)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5283)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
I tried to find where it was error but I haven't found it either, maybe there is advice what to do to fix the error?
Thank You
-
Hi Nur Sulaeman! Could you provide the following information please?
- What version of the Zendesk for Android SDK are you using?
- Please make sure you've enabled logging for your SDK implementation. Is your implementation throwing any errors?
- Please provide the code where you've initialized the SDK.
- Finally, if there is any more info you can provide (problematic code, sample project, etc), that would be great!
-
Hi,
we're starting to see the same crash since we bumped from 2.0.0 to 2.2.0
Fatal Exception: java.lang.NoSuchMethodErrorNo 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/...-sdwCZyqq0rhm8Fse9PbrvA==/base.apk!classes6.dex)zendesk.messaging.MessagingModel.<clinit> -
Hi LN Andrieux! Could you please share the information that I requested in my above post?
-
Hello All' sorry I was late to reply to a message, I have successfully solved the error
LN Andrieux maybe there is still an old code that hasn't been deleted, if you find an old code like this
Zendesk.INSTANCE.setIdentity(identity), You don't need to use it again and delete it
if a different case can be informed again
Thank you Greg for attention -
Thank you for the update, Nur!
-
Hi, I'm having the exactly same issue 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.
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)
} -
Hi, I can tell you that I had the same error and got it fixed by removing the extra line in the build:
implementation group: 'com.zendesk', name: 'support', version: '5.0.2'
I hope this helps.
댓글을 남기려면 로그인하세요.
7 댓글