chat-sdk / chat-sdk-android

Chat SDK Android - Open Source Mobile Messenger
https://chatsdk.co
Other
1.61k stars 611 forks source link

Android app crash #744

Closed ronaldo-triibo closed 7 months ago

ronaldo-triibo commented 1 year ago
  1. Is the bug present in the demo Chat SDK project? Not sure, as it cannot access the chat activity.

  2. What modifications have you made to the Chat SDK? None.

  3. Android Version: 13

  4. Steps taken to reproduce the problem: Add ChatSDK to Android project and try to use it

  5. Expected result: No crashes

  6. Actual result: App crashes when opening chat activity

  7. Comments: Logcat shows: Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content at com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:402) at sdk.chat.ui.activities.BaseActivity.onCreate(Unknown Source:26) at sdk.chat.ui.activities.ChatActivity.onCreate(Unknown Source:0)

logcat.txt

bensmiley commented 1 year ago

Can you test the latest version and tell me if this is still a problem?

ronaldo-triibo commented 1 year ago

Hi, thanks for your reply! I've tried with version 5.4.6 (which is the latest I could use due to other project dependencies) and the issue still happens.

bensmiley commented 1 year ago

Unfortunately I can’t fix old versions. Because this issue has probably been fixed already in the latest version. So the options are to upgrade or take some priority support time to get me to fix the issue and make a new release.

ronaldo-triibo commented 1 year ago

Hi, Ben! Indeed, I created a new Android project and added the newest SDK and the issue does not happen. Please disregard this issue.

ronaldo-triibo commented 1 year ago

Hello, Ben! Unfortunately it was may mistake: after I updated my project and its dependencies so I could be able to use the 5.5.1 version of chatSDK for Android, I found out that the issue still happens:

java.lang.RuntimeException: Unable to start activity ComponentInfo{***.MyCustomChatActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content

And the issue seems to be on BaseActivity.onCreate.

ronaldo-triibo commented 7 months ago

I've found out that the problem was actually in the androidx.appcompat dependency. I had to upgrade my app to the following settings: