Pushwoosh / pushwoosh-react-native-plugin

Other
57 stars 43 forks source link

presentInboxUI Android crash #97

Closed Ufosek closed 4 years ago

Ufosek commented 4 years ago

Hi,

I have some problems with InboxUI, this is how I implemented this:

    Pushwoosh.presentInboxUI({
      backgroundColor: processColor(theme.colors.secondary),
      barBackgroundColor: processColor(theme.colors.secondary),
      barAccentColor: processColor(theme.colors.primary),
      barTextColor: processColor(theme.colors.primary),
      accentColor: processColor(theme.colors.primary),
      descriptionColor: processColor(theme.colors.primary),
      titleColor: processColor(theme.colors.primary),
      dateColor: processColor(theme.colors.primary),
      highlightColor: processColor(theme.colors.grey1),
      listEmptyMessage: "No notifications",
      listErrorMessage: "Could not load notifications",
    })

The biggest problem is that on some Android devices it causes app to crash, and these are the logs I get from Crashlytics:

Fatal Exception: java.lang.NoSuchMethodError
No virtual method apply(Lcom/bumptech/glide/request/RequestOptions;)Lcom/bumptech/glide/RequestBuilder; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in base.apk)

com.pushwoosh.inbox.ui.presentation.view.adapter.inbox.InboxViewHolder.fillView (InboxViewHolder.kt:107)
com.pushwoosh.inbox.ui.presentation.view.adapter.inbox.InboxViewHolder.fillView (InboxViewHolder.kt:57)
com.pushwoosh.inbox.ui.presentation.view.adapter.BaseRecyclerAdapter.onBindViewHolder (BaseRecyclerAdapter.kt:66)
com.pushwoosh.inbox.ui.presentation.view.adapter.inbox.InboxAdapter.onBindViewHolder (InboxAdapter.kt:70)
com.pushwoosh.inbox.ui.presentation.view.adapter.inbox.InboxAdapter.onBindViewHolder (InboxAdapter.kt:39)
androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder (RecyclerView.java:6781)

Maybe this is this error: https://github.com/bumptech/glide/issues/3539

So it looks like there is a problem with loading image of notification.

On iOS everything works fine and displays fine but sometimes I get error when loading and from logs I could get:

{"status_code":500,"status_message":"Internal server error","response":null}

This is not that important as this first issue but maybe also worth looking at.

Version: "pushwoosh-react-native-plugin": "^5.20.3"

Regards

wfhm commented 4 years ago

Hi,

Checking it.

The biggest problem is that on some Android devices it causes app to crash, and these are the logs I get from Crashlytics

Do you have any information on which particular device models this crash occurs?

Ufosek commented 4 years ago

For sure we had crashes on Samsung Galaxy S9. I was also testing it on S8 and it worked but I am not sure whether on S8 there were any pushes to display (if list was empty no image would be loaded).

wfhm commented 4 years ago

Hi @Ufosek,

Thanks, please let me pull some time to investigate the issue. I will come back to you as soon as there is any news.

wfhm commented 4 years ago

@Ufosek,

Could you please specify to which particular version the com.github.bumptech.glide:glide library is resolved in your project? Pushwoosh Inbox lib supports [4.4.0, 4.9.0) versions, so, if the library is resolved to an older or a newer version, it could cause this crash.

Most probably, there is another plugin that uses glide library of a different version, so it causes a conflict. Could you please check it?

Ufosek commented 4 years ago

@wfhm

I use 3 libs that uses glide: pushwoosh-react-native-plugin: com.github.bumptech.glide:glide:4.7.1 react-native-fast-image: com.github.bumptech.glide:glide:4.9.0 react-native-track-player: com.github.bumptech.glide:glide:4.7.1

wfhm commented 4 years ago

@Ufosek,

The conflict is caused by the 4.9.0 version in the react-native-fast-image - our plugin supports the versions lower than 4.9.0. By any chance could you please try lowering the version in the fast-image plugin or completely excluding it and let us know about the results?

Ufosek commented 4 years ago

@wfhm

I can confirm that after removing fast-image library InBox works properly. However this is not a solution. Do you have any plans to upgrade your plugin to support latest glide version or have any recommendations how to deal in such case?

wfhm commented 4 years ago

@Ufosek,

This is indeed not a solution. The solution would be to make both plugins use the same version of Glide lib, however, right now, Pushwoosh plugin does not work with 4.9.0+ versions, and react-native-fast-image just updated it to 4.11.0 to fix some internal issues. So we will need to add support for the latest Glide versions on our side. I cannot provide you with any ETA right now, however, I will let you know as soon as there is any news.

wfhm commented 4 years ago

@Ufosek,

Newer Glide lib versions are now supported with the latest plugin release. Please try updating it and let us know about the results.