Matisse icon indicating copy to clipboard operation
Matisse copied to clipboard

MatisseActivity : android.view.InflateException

Open jayakrishnan-pm opened this issue 4 years ago • 3 comments

InflateException in v0.5.3-beta3

New crash reported in the latest beta version of the library. My live app's stability has been affected by this exception and many exceptions are keeping coming. Kindly advice for a solution. Thanks in advance.

Lib Version : v0.5.3-beta3 (Prev version: v0.5.2) Android Version: 10, API Level 29 Device: OPPO CPH1723

com.zhihu.matisse.ui.MatisseActivity}: android.view.InflateException: Binary XML file line #33: Binary XML file line #33: Error inflating class TextView
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2904)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2969)
       at android.app.ActivityThread.-wrap12(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:232)
       at android.app.ActivityThread.main(ActivityThread.java:6699)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1103)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

Steps to reproduce App crashes when calling the following method on button click,

Matisse.from(getActivity())
                   .choose(MimeType.ofImage(), false)
                   .theme(R.style.GalleryBrowseTheme)
                   .countable(false)
                   .showSingleMediaType(true)
                   .maxSelectable(1)
                   .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
                   .thumbnailScale(0.85f)
                   .imageEngine(new Glide4Engine())
                   .forResult(REQUEST_CODE_CHOOSE);

jayakrishnan-pm avatar Oct 28 '20 14:10 jayakrishnan-pm

Same with you, this only happened when you use your own theme, how to fix this?

zdd avatar Nov 04 '20 06:11 zdd

@zdd Below is the customized theme used in the code.

<style name="GalleryBrowseTheme" parent="Matisse.Zhihu">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    </style>

jayakrishnan-pm avatar Nov 04 '20 11:11 jayakrishnan-pm

@zdd Below is the customized theme used in the code.

<style name="GalleryBrowseTheme" parent="Matisse.Zhihu">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    </style>

thank you, it works

zdd avatar Nov 06 '20 03:11 zdd