why i get Some file crunching failed after i rename drawable file to .9.png?

后端 未结 9 898
盖世英雄少女心
盖世英雄少女心 2021-02-07 07:40

I am testing 9-patch image .
Before everything works fine , and i rename drawable file ic_button_beat_box_default.png to ic_button_beat_box_d

相关标签:
9条回答
  • 2021-02-07 08:04

    What solved it for me was to set

    aaptOptions {  
        cruncherEnabled = false  
    }
    

    Then to run the app (icons were missing) then remove this option and run the app again. Hope it helps somebody.

    0 讨论(0)
  • 2021-02-07 08:09

    try this, insert this code in android section in app gradle:

    aaptOptions {  
        cruncherEnabled = false  
    }
    
    0 讨论(0)
  • 2021-02-07 08:09

    This worked for me:

    Build -> Clean Project.

    and then

    Build -> Rebuild Project.

    0 讨论(0)
  • 2021-02-07 08:11

    I had the same issue. I was able to resolve it just by reducing one folder from chain. It is due to long file path. So try using minimum hierarchy for your project location.

    0 讨论(0)
  • 2021-02-07 08:11

    Try setting this in your defaultConfig:

    aaptOptions.setProperty("cruncherEnabled", false)
    
    0 讨论(0)
  • 2021-02-07 08:24

    Rename your file again

    ic_button_beat_box_default.9.png to ic_button_beat_box_default9.png because android studio takes ic_button_beat_box_default.9 instead of ic_button_beat_box_default.9.png

    or another solution is add below line to your build.gradle(Module:app)

    android{
     aaptOptions {cruncherEnabled = false} 
    }
    
    0 讨论(0)
提交回复
热议问题