helpcrunch / android-sdk-demo

Public demo for HelpCrunch Android SDK
Apache License 2.0
9 stars 1 forks source link

Crash on Activity opening (due to emoji) #4

Closed apaolino closed 5 years ago

apaolino commented 5 years ago

I'm using android sdk version 1.5.2. On app opening it logs this: java.io.FileNotFoundException: emoticons/emoji.json

then, when I open the Chat Activity it crashes with the following exception:

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference E/AndroidRuntime( 8773): at com.helpcrunch.emojify.EmojiUtils.getEmoji(EmojiUtils.java:23) E/AndroidRuntime( 8773): at com.helpcrunch.library.model.Message.setText(Message.java:119) E/AndroidRuntime( 8773): at com.helpcrunch.library.networking.PostMessageCommand.<init>(PostMessageCommand.java:25) E/AndroidRuntime( 8773): at com.helpcrunch.library.core.HelpCrunch.postMessage(HelpCrunch.java:190) E/AndroidRuntime( 8773): at com.helpcrunch.library.ui.HelpCrunchChatFragment.lambda$onViewCreated$4(HelpCrunchChatFragment.java:453) E/AndroidRuntime( 8773): at com.helpcrunch.library.ui.-$$Lambda$HelpCrunchChatFragment$Yq7Jzh_Btqo-NA68mMxgCrAk9EA.onClick(Unknown Source:2) E/AndroidRuntime( 8773): at android.view.View.performClick(View.java:6597) E/AndroidRuntime( 8773): at android.view.View.performClickInternal(View.java:6574) E/AndroidRuntime( 8773): at android.view.View.access$3100(View.java:778) E/AndroidRuntime( 8773): at android.view.View$PerformClick.run(View.java:25885) E/AndroidRuntime( 8773): at android.os.Handler.handleCallback(Handler.java:873) E/AndroidRuntime( 8773): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 8773): at android.os.Looper.loop(Looper.java:193) E/AndroidRuntime( 8773): at android.app.ActivityThread.main(ActivityThread.java:6718) E/AndroidRuntime( 8773): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 8773): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/AndroidRuntime( 8773): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

TalbotGooday commented 5 years ago

Can you tell me, please, android version of a phone or emulator? This should lift a shadow off this issue

apaolino commented 5 years ago

I'm using Android 9 on both the phone and emulator. If emoji features are recent, could you tell me a sdk version without them, so I can use helpcrunch without problems?

TalbotGooday commented 5 years ago

Thank you. Emoji was added in the earliest versions. The better way is to wait for update than to use earlier versions.

apaolino commented 5 years ago

We have an app ready for production and our users wouldn't be able to communicate with our support without helpcrunch. Do you have any eta on this or, at least, tell me which is the latest working sdk version

TalbotGooday commented 5 years ago

Out team is working on this bug just right now. I'll let you know about the results asap. Right now we cant reproduce this bug on Android 9, so the problem might be hides in your IDE. Just try to Clean Project and Invalidate Caches/Restart.

apaolino commented 5 years ago

Tried but no success. I'm using Flutter but using Helpcrunch in native android code. Analyzing the result apk seems that the path emoticons/emoji.json doesn't exist in the android asset folder.

TalbotGooday commented 5 years ago

Flutter. Ok, I got it. It's a good question for the Flutter SDK. I should ask about this earlier. We'll see what we can do with it. Please, wait for an answer. Now try the next thing, please: Inside your pubspec.yaml file add this:

flutter:
    assets:
-assets/flutter_assets/assets/emoticons/emoji.json
apaolino commented 5 years ago

It doesn't work. Are emoji fundamental to get the chat working? Could you provide a new version in which the chat could work also if emojis are not available?

apaolino commented 5 years ago

Analyzing the apk I've a "emojis.json" in the root folder. I've also tried to move it into "src/main/assets/emoticons/emoji.json" but no success.

TalbotGooday commented 5 years ago

Can you give me more information how exactly connected our SDK. We did not have any errors when added and run our SDK in a Flutter project. We can't reproduce this issue right now

apaolino commented 5 years ago

Just discovered the problem: I had gradle version set to 3.3.2 , I've just tried 3.3.1 and it works. Edit: With values greater than 3.3.1 it doesn't work. Thanks for help

TalbotGooday commented 5 years ago

Thank you for describing the solution

charleshan commented 5 years ago

@TalbotGooday It would be nice to have a flutter package. We've been looking for an intercom alternative.

TalbotGooday commented 5 years ago

@TalbotGooday It would be nice to have a flutter package. We've been looking for an intercom alternative.

@charleshan Hi. Unfortunatelly we have no opportunity to create and publish Flutter package now. We plan to do it in the future, but now you can add separately Android and iOS SDK to your Flutter project.