Matisse: R$plurals class wasn't found.

Created on 7 Jun 2018  ·  3Comments  ·  Source: zhihu/Matisse

The app crashes every time you try to select a second file and is limited to one file .countable(false) & maxSelectable(1).

The error text doesn't seem to be bundled with the library for some reason.

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/zhihu/matisse/R$plurals;
at com.zhihu.matisse.internal.model.SelectedItemCollection.isAcceptable(SelectedItemCollection.java:175)
at com.zhihu.matisse.internal.ui.adapter.AlbumMediaAdapter.assertAddSelection(AlbumMediaAdapter.java:206)
at com.zhihu.matisse.internal.ui.adapter.AlbumMediaAdapter.onCheckViewClicked(AlbumMediaAdapter.java:185)
at com.zhihu.matisse.internal.ui.widget.MediaGrid.onClick(MediaGrid.java:71)
at android.view.View.performClick(View.java:6896)
at android.view.View$PerformClick.run(View.java:26088)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Most helpful comment

For those who really need a fix before maintainer resolves this one:
Add the following lines to your strings.xml

    <plurals name="error_over_count">
        <item quantity="one">You can only select one media file</item>
        <item quantity="many">You can only select up to %1$d media files</item>
    </plurals>

and attempting to select more than limited number of media files should produce the toast properly.

All 3 comments

Reproducing the issue described by OP.

The cause seem to be referencing R.plurals.xxx in the file SelectedItemCollection.java

Version 0.5.0 beta 9

For those who really need a fix before maintainer resolves this one:
Add the following lines to your strings.xml

    <plurals name="error_over_count">
        <item quantity="one">You can only select one media file</item>
        <item quantity="many">You can only select up to %1$d media files</item>
    </plurals>

and attempting to select more than limited number of media files should produce the toast properly.

Thanks @jilulu ... that fixed it for me :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cv0cv0 picture cv0cv0  ·  7Comments

Mahan3340 picture Mahan3340  ·  4Comments

zouzhenglu picture zouzhenglu  ·  4Comments

naivor picture naivor  ·  7Comments

Jocerly picture Jocerly  ·  4Comments