因爲項目中出現了知乎的開源框架MatisseActivity,其實就是一個圖片選擇器,但是有一個問題就是:我點擊了9張圖片,並設置最多隻能選擇9張,但是選擇第十張時,圖片就崩潰了,並且報了以下錯誤
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/zhihu/matisse/R$plurals
原因是因爲缺少資源plurals的定義,因爲其中提到資源文件R,在項目的string.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>