android.content.res.Resources$NotFoundException for ic_sync_black_24dp.xml

前端 未结 3 1667
栀梦
栀梦 2021-01-11 12:42

I\'ve struggled with this for over a week, because I figure it has to be something with my environment, but I can\'t narrow it down.

I start an empty project, add a

相关标签:
3条回答
  • 2021-01-11 13:08

    Lewis noticed the clue that help me resolve the issue. I changed the 24.0 to 24

    android:width="24dp"
    android:height="24dp"
    

    And now the code executes without error! Thanks Lewis!

    0 讨论(0)
  • 2021-01-11 13:13

    Seems that the issue lay with API 21, the 24.0dp that was mentioned did not solve the issue for me instead I was receiving:

    E/PathParser: error in parsing "c-3.31 0,-6,-2.69,-6,-6 0,-1.01.25,-1.97.7,-2.8"
    

    I found the answer at https://github.com/google/material-design-icons/issues/225

    It turns out the pathData is invalid cannot be parsed in API 21 properly (the problem does not exist in API 22 or 23). Simply replace the pathData with:

    android:pathData="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-.25 1.97,-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01 .25,-1.97 .7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z"
    
    0 讨论(0)
  • 2021-01-11 13:26

    The problem may be your setting for you "Target SDK". Default behaviour may be setting Android 6. Set it for Android 5.0.1 (21), and ensure you have downloaded the SDK from the SDK Manager. You've probably created the settings activity using the wizard before doing this, so you should delete the settings activity, make sure you have the appropriate SDK and project settings, and re-create it.

    0 讨论(0)
提交回复
热议问题