Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deprecate CoilContentProvider. #293

Merged
merged 2 commits into from
Feb 15, 2020
Merged

Conversation

colinrtwhite
Copy link
Member

Each new ContentProvider adds a slight penalty to app startup time. For Coil to be 100% lazy, we should remove the ContentProvider. Fortunately, this only affects Coil.get which now requires a context.

@colinrtwhite colinrtwhite merged commit 33c2cda into master Feb 15, 2020
@colinrtwhite colinrtwhite deleted the colin/deprecate_content_provider branch February 15, 2020 17:33
@premacck
Copy link

premacck commented Apr 18, 2020

@colinrtwhite When will this be released?
I am facing a crash in production app, was wondering whether this crash would be fixed by this

Fatal Exception: kotlin.UninitializedPropertyAccessException: lateinit property context has not been initialized
       at coil.util.CoilContentProvider$Companion.getContext$coil_default_release(CoilContentProvider.java:21)
       at coil.Coil.buildDefaultImageLoader(Coil.java:47)
       at coil.Coil.loader(Coil.java:19)
       at com.doi.garasi.core.base.ui.component.ImageLoaderKt.loadUrl$default(ImageLoaderKt.java:35)
       at com.doi.garasi.core.listing.epoxylayout.ListingItemLayout.withListing(ListingItemLayout.java:49)
       at com.doi.garasi.core.listing.epoxylayout.ListingItemLayout.withListing(ListingItemLayout.java:44)
       at com.doi.garasi.core.listing.epoxylayout.ListingItemLayoutModel_.bind(ListingItemLayoutModel_.java:112)
       at com.doi.garasi.core.listing.epoxylayout.ListingItemLayoutModel_.bind(ListingItemLayoutModel_.java:35)
       at com.airbnb.epoxy.EpoxyViewHolder.bind(EpoxyViewHolder.java:60)
       at com.airbnb.epoxy.BaseEpoxyAdapter.onBindViewHolder(BaseEpoxyAdapter.java:97)
       at com.airbnb.epoxy.BaseEpoxyAdapter.onBindViewHolder(BaseEpoxyAdapter.java:15)
       at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
       at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
       at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
       at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
       at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
       at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
       at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
       at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
       at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
       at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
       at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3336)
       at android.view.View.measure(View.java:19140)
       at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1248)
       at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1593)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
       at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
       at android.view.View.measure(View.java:19140)
       at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1248)
       at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1593)
       at android.view.View.measure(View.java:19140)
       at androidx.core.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1562)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at androidx.core.widget.NestedScrollView.onMeasure(NestedScrollView.java:584)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at android.view.View.measure(View.java:19140)
       at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1698)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
       at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
       at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6115)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
       at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2725)
       at android.view.View.measure(View.java:19140)
       at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2511)
       at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1475)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1729)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1356)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6877)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:894)
       at android.view.Choreographer.doCallbacks(Choreographer.java:696)
       at android.view.Choreographer.doFrame(Choreographer.java:631)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:880)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5743)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)

Or can I get a snapshot version if it is present?

@colinrtwhite
Copy link
Member Author

@premacck Hmm seems like the ContentProvider has not been initialized. The next release should fix the issue as we're removing the dependency on the content provider. The next release will be out before Monday, however if you want it ASAP, you can get the snapshot by following the instructions here.

colinrtwhite added a commit that referenced this pull request Oct 5, 2022
* Deprecate CoilContentProvider.

* Revert README.md changes.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants