调用此方法:
IntercomSdk.Intercom.Client().DisplayMessenger();
我得到了这个例外:
[AndroidRuntime] java.lang.NoSuchMethodError: No virtual method onNestedFling(Landroid/support/design/widget/CoordinatorLayout;Landroid/support/design/widget/AppBarLayout;Landroid/view/View;FFZ)Z in class Landroid/support/design/widget/AppBarLayout$Behavior; or its super classes (declaration of 'android.support.design.widget.AppBarLayout$Behavior' appears in /data/app/es.smartloto.smartloto-dvf2COkzGja7r9FkpKRG-Q==/base.apk
[AndroidRuntime] at io.intercom.android.sdk.profile.ProfileCoordinator.flingCoordinator(ProfileCoordinator.java:191)
[AndroidRuntime] at io.intercom.android.sdk.profile.ProfileCoordinator.profileAutoOpened(ProfileCoordinator.java:175)
[AndroidRuntime] at io.intercom.android.sdk.conversation.ConversationFragment.sdkWindowFinishedAnimating(ConversationFragment.java:643)
[AndroidRuntime] at io.intercom.android.sdk.activities.IntercomMessengerActivity$3.onAnimationEnd(IntercomMessengerActivity.java:244)
[AndroidRuntime] at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1122)
[AndroidRuntime] at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:552)
[AndroidRuntime] at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1209)
[AndroidRuntime] at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1449)
[AndroidRuntime] at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
[AndroidRuntime] at android.animation.AnimationHandler.-wrap2(Unknown Source:0)
[AndroidRuntime] at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
[AndroidRuntime] at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
[AndroidRuntime] at android.view.Choreographer.doCallbacks(Choreographer.java:723)
[AndroidRuntime] at android.view.Choreographer.doFrame(Choreographer.java:655)
[AndroidRuntime] at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
[AndroidRuntime] at android.os.Handler.handleCallback(Handler.java:789)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:98)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:164)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:6541)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
我测试了不同的选项以尝试解决问题,但我找不到解决方案。 感谢您的帮助,谢谢!!
答案 0 :(得分:0)
我找到了错误的原因。
如果你的项目中有一个较新版本的android支持库而不是java aar所构建的,那么就会发生这种情况。 Intercom的大多数绑定使用Intercom Android SDK Version 3.0.XX,它是针对API Level 25(支持库25.XX.XX)构建的,我认为。 我可以通过为最新版本的Intercom Android SDK创建自己的绑定来解决这个问题,这些绑定是针对API Level 27构建的,我碰巧在我的项目中使用它。
基本上你有两个选择:
我可能会在某些时候将新的Intercom Android SDK的绑定上传到github,但是我可能需要一些时间才能这样做。