Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build breaks using webp splash images instead of PNG #257

Closed
2 of 3 tasks
ausias-armesto opened this issue May 6, 2020 · 1 comment · Fixed by apache/cordova-android#1113
Closed
2 of 3 tasks

Comments

@ausias-armesto
Copy link

Bug Report

Problem

I have changed my config.xml to use reduced images. I have used the *.webp format having a config.xml similar to this

    <platform name="android">
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.webp" />
...
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.webp" />
       ...
    </platform>

What is expected to happen?

I would expect the plugin to accept the format of the image specified in the src attribute

What does actually happen?

I guess the only format accepted is PNG and the error produced is:

* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
  /Users/ausias/Trabajo/Workspaces/biometric-signature/mobile-app/biometric-signature-app/platforms/android/app/src/main/res/drawable-port-mdpi/screen.png: error: failed to read PNG signature: file does not start with PNG signature.

Information

I attach the *.webp format of the cordova logo image.
sample-files.zip

Command or Code

using the build command:

ionic cordova build android --release

Version information

Ionic:

   Ionic CLI                     : 5.2.3 (/Users/ausias/.nvm/versions/node/v13.6.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.2.2
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.3, (and 20 other plugins)

Utility:

   cordova-res : 0.8.1 (update available: 0.14.0)
   native-run  : 0.3.0 (update available: 1.0.0)

System:

   Android SDK Tools : 26.1.1 (/Users/ausias/Library/Android/sdk)
   NodeJS            : v13.6.0 (/Users/ausias/.nvm/versions/node/v13.6.0/bin/node)
   npm               : 6.13.4
   OS                : macOS High Sierra

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek
Copy link
Contributor

breautek commented May 6, 2020

Traditionally we only supported PNG files because webp support in android is only available as of API 17. But since cordova-android@8 minimum API support is 19, (and will be increased to I believe 21 if my memory recalls correctly...) I see no reason why we can't extend support to webp, especially since android appears to recommend using webp as your first choice, if possible.

I'll add the enhancement flag to this.

Edit: Also adding the android flag... as I don't think this is applicable to iOS at all, because of their storyboard system. But I don't think this is a big concern as android assets and ios assets always had to be handled independently anyway for splashscreens.

PieterVanPoyer added a commit to PieterVanPoyer/cordova-android that referenced this issue Oct 20, 2020
PieterVanPoyer added a commit to PieterVanPoyer/cordova-android that referenced this issue Oct 20, 2020
PieterVanPoyer added a commit to PieterVanPoyer/cordova-android that referenced this issue Nov 1, 2020
- platform independent paths in testing
- addes some unittest
- remove duplication + add comments
- delete webp's if png's added, delete png's if webp' added.
- Update bin/templates/cordova/lib/prepare.js Co-authored-by: エリス <[email protected]>
- fix apache/cordova-plugin-splashscreen#257 webp support for android
breautek pushed a commit to apache/cordova-android that referenced this issue Dec 16, 2020
* - linting
- platform independent paths in testing
- addes some unittest
- remove duplication + add comments
- delete webp's if png's added, delete png's if webp' added.
- Update bin/templates/cordova/lib/prepare.js Co-authored-by: エリス <[email protected]>
- fix apache/cordova-plugin-splashscreen#257 webp support for android

* revert changes

* refactor: use source extension for target in getImageResourcePath

* fix(prepare): include more extensions in initial splash-screen resource map

* tests(prepare): quick-fix for tests

* backward slashes must be changed to forward slashes for fast-glob package.

Co-authored-by: Raphael von der Grün <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants