How to update to more recent Android SDK versions? Getting Glide IllegalStateException | Community
Skip to main content
Answered

How to update to more recent Android SDK versions? Getting Glide IllegalStateException

  • October 18, 2020
  • 4 replies
  • 79 views

After updating to more recent versions from 7.1.0, we are getting:

 

Caused by: java.lang.IllegalStateException: You cannot call Glide.get() in registerComponents(), use the provided Glide instance instead

    at io.intercom.com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:172)

    at io.intercom.com.bumptech.glide.Glide.get(Glide.java:160)

    at io.intercom.com.bumptech.glide.Glide.getRetriever(Glide.java:612)

    at io.intercom.com.bumptech.glide.Glide.with(Glide.java:638)

    at io.intercom.android.sdk.Injector.getOverlayPresenter(Injector.java:220)

    at io.intercom.android.sdk.RealIntercom.create(RealIntercom.java:78)

    at io.intercom.android.sdk.Intercom.initialize(Intercom.java:69)

    at me.sphere.app.data.interactors.IntercomInteractorImpl.initIntercom(IntercomInteractor.kt:24)

    at me.sphere.app.data.interactors.IntercomInteractorImpl.logEvent(IntercomInteractor.kt:41)

 

Our application has no dependencies to Glide.

Best answer by Lisa B11

Hey @attila​ 👋

 

In version 8.0.0 of our Android SDK we have updated to use OkHttp 4. OkHttp 4 requires we compile with Java 8. This means you will need to update to Java 8 before using the newest version of our SDK. You can follow the instructions here.

 

Can you try that and let me know how it goes?

4 replies

Forum|alt.badge.img+5
  • Employee
  • Answer
  • October 20, 2020

Hey @attila​ 👋

 

In version 8.0.0 of our Android SDK we have updated to use OkHttp 4. OkHttp 4 requires we compile with Java 8. This means you will need to update to Java 8 before using the newest version of our SDK. You can follow the instructions here.

 

Can you try that and let me know how it goes?


  • Author
  • New Participant
  • October 21, 2020

Interesting we are already using okHttp 4.2.2 & compile with Java 8.

 

Will dig into details some more, to see where the issue might be coming from.


  • Author
  • New Participant
  • November 15, 2020

We are still seeing the same issue on the latest Android SDK release 8.3.0

 

Caused by: java.lang.IllegalStateException: You cannot call Glide.get() in registerComponents(), use the provided Glide instance instead

    at io.intercom.com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:172)

    at io.intercom.com.bumptech.glide.Glide.get(Glide.java:160)

    at io.intercom.com.bumptech.glide.Glide.getRetriever(Glide.java:612)

    at io.intercom.com.bumptech.glide.Glide.with(Glide.java:638)

    at io.intercom.android.sdk.Injector.getOverlayPresenter(Injector.java:220)

    at io.intercom.android.sdk.RealIntercom.create(RealIntercom.java:81)

    at io.intercom.android.sdk.Intercom.initialize(Intercom.java:69)

    at me.sphere.app.data.interactors.IntercomInteractorImpl.initIntercom(IntercomInteractor.kt:27)

    at me.sphere.app.data.interactors.IntercomInteractorImpl.logEvent(IntercomInteractor.kt:42)

 

As mentioned before we don't have dependency on Glide.

Since this is a runtime crash, I don't think OkHttp 4 / Java 8 would have anything to do with this, compilation should fail in that case.


  • Author
  • New Participant
  • November 18, 2020

We have resolved the issue successfully.

 

The initialisation code Intercom.init ... was executed on a computation thread.

Moving it to main thread resolved the issue. (following the SDK integration guide this should not be an issue.)