You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/02 14:33:03 UTC

[GitHub] [cordova-android] AshleyScirra opened a new issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

AshleyScirra opened a new issue #984:
URL: https://github.com/apache/cordova-android/issues/984


   # Bug Report
   
   Sample project: 
   [test.zip](https://github.com/apache/cordova-cli/files/4703578/test.zip)
   
   Extract and run:
   `cordova platform add android`
   `cordova prepare android`
   
   ## Problem
   
   It fails with `Cannot read property 'startsWith' of undefined`.
   
   ### What is expected to happen?
   
   Successful prepare
   
   ### What does actually happen?
   
   It fails with an error message
   
   ## Information
   
   This only happens if you have both a normal and an adaptive icon.
   
   ### Command or Code
   Included above
   
   ### Environment, Platform, Device
   Windows 10 64-bit
   
   ### Version information
   Cordova 9.0.0 (cordova-lib@9.0.1)
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   
   Note: I wasn't sure where the right place to file this was, so it's also filed at https://github.com/apache/cordova-cli/issues/506


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-646050908


   It's already merged in master, so you can install from git master...
   
   ```
   cordova platform remove android
   cordova platform add https://github.com/apache/cordova-android.git
   ```
   
   It will appear on the next nightly build, but that's in like 10-11 hours from now.
   
   If you could verify asap that would be helpful, because we are *planning* on starting the release process very soon.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek closed issue #984:
URL: https://github.com/apache/cordova-android/issues/984


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-645734148


   If you can test #1001 PR to ensure that the PR addresses your issue, that would be greatly appreciated :+1:


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek edited a comment on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-645726277


   Observed the error on nightly builds.
   
   Logging produces:
   
   ```
   ANDROID_ICONS {
     xxxhdpi: ImageResource {
       platform: null,
       src: 'www/img/icon-512.png',
       target: undefined,
       density: 'xxxhdpi',
       width: 512,
       height: 512,
       background: undefined,
       foreground: undefined
     },
     xhdpi: ImageResource {
       platform: null,
       src: 'www/img/icon-128_fore.png',
       target: undefined,
       density: 'xhdpi',
       width: undefined,
       height: undefined,
       background: 'www/img/icon-128_back.png',
       foreground: 'www/img/icon-128_fore.png'
     }
   }
   ```
   
   It appears that Cordova doesn't like having a mixture of adaptive and non-adaptive icons... it appears to be caused by having:
   
   `<icon width="512" height="512" density="xxxhdpi" src="www/img/icon-512.png"/>`
   
   in `config.xml` while there is another `<icon>` entry that has `background` and `foreground` properties.
   
   I believe skipping over the icon if it doesn't have both background/foreground properties defined is the appropriate action to take. Perhaps produce a warning if it finds one attribute but not the other.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-645726277


   Observed the error on nightly builds.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] AshleyScirra commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
AshleyScirra commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-646055978


   Using `cordova platform add https://github.com/apache/cordova-android.git` and `cordova prepare` appears to succeed without the error. I happened to run it in WSL if it makes any difference, that also reproduced the original issue only using `cordova platform add android` (i.e. latest published). So it looks like it's fixed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] AshleyScirra commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
AshleyScirra commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-646078438


   Good to know, thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] AshleyScirra commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
AshleyScirra commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-646048369


   I'd like to test it, but it's not clear how to apply that patch to an existing Cordova setup. I can't find the `updateIconResourceForAdaptive` method. Are there nightly releases of Cordova I could try? Or is there any indication when the next Android release will be? It looks like the last release was several months ago.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-646057340


   Great! Thank you for your time and effort, and of course bringing attention to this issue to us. The fix will be included in the 9.0.0 release, which should be happening soon.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek edited a comment on issue #984: Build error 'cannot read property startsWith of undefined' when using adaptive icons

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #984:
URL: https://github.com/apache/cordova-android/issues/984#issuecomment-645726277


   Observed the error on nightly builds.
   
   Logging produces:
   
   ```
   ANDROID_ICONS {
     xxxhdpi: ImageResource {
       platform: null,
       src: 'www/img/icon-512.png',
       target: undefined,
       density: 'xxxhdpi',
       width: 512,
       height: 512,
       background: undefined,
       foreground: undefined
     },
     xhdpi: ImageResource {
       platform: null,
       src: 'www/img/icon-128_fore.png',
       target: undefined,
       density: 'xhdpi',
       width: undefined,
       height: undefined,
       background: 'www/img/icon-128_back.png',
       foreground: 'www/img/icon-128_fore.png'
     }
   }
   ```
   
   It appears that Cordova doesn't like having a mixture of adaptive and non-adaptive icons... it appears to be caused by having:
   
   `<icon width="512" height="512" density="xxxhdpi" src="www/img/icon-512.png"/>`
   
   in `config.xml` while there is another `<icon>` entry that has `background` and `foreground` properties.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org