google / guetzli

Perceptual JPEG encoder
Apache License 2.0
12.91k stars 976 forks source link

encode a png and use in AndroidStudio have an error #113

Closed NoahZu closed 7 years ago

NoahZu commented 7 years ago

Error:Execution failed for task ':app:merge Guanfang Debug Resources'. > Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

cwh-github commented 7 years ago

how to import guetzli into android studio?

robryk commented 7 years ago

@NoahZu The message you're posting should be longer (there should be something at the end of it). Could you post all of it?

@cwh-github I'm sadly unfamiliar with adding native libraries to Android projects.

NoahZu commented 7 years ago

ok,

  1. I uset guetzli covert a bigger png image to smaller it's login_bg.png
  2. in copy it to the mipmap-xxhdpi
  3. I click Sync Project with Gradle Files
  4. I get the log:

    Error:Execution failed for task ':app:mergeDebugResources'. Error: java.lang.RuntimeException: Crunching Cruncher login_bg.png failed, see logs

  5. and then i check the detail logs, bug did not find associated log thx for you solutions @robryk
robryk commented 7 years ago

Guetzli creates JPEG files. If you save a Guetzli-created file with a .png extension, it will still be a JPEG file and it will confuse all the software that expects it to be a PNG file. I expect that using e.g. login_bg.jpg as the filename should help.

NoahZu commented 7 years ago

@robryk thank you very much