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

Existing color definitions in colors.xml get overriden #436

Closed
5 tasks done
ajberasategui opened this issue Jun 22, 2020 · 0 comments
Closed
5 tasks done

Existing color definitions in colors.xml get overriden #436

ajberasategui opened this issue Jun 22, 2020 · 0 comments
Labels
android Relates to Android platform bug Something isn't working properly

Comments

@ajberasategui
Copy link

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

Running prepare for Android platform overrides colors.xml by removing everything in it and adding only the Accent color required by this plugin.

Expected behavior:

The plugin after prepare script actually tries not to override existing colors but instead adding the accent one, but it fails because of a wrong condition check.

Steps to reproduce:

  1. Clone test project.
  2. Manually define custom colors in colors.xml Android file.
  3. Run cordova prepare Android
  4. Check colors.xml file contents. Step 2 colors are gone.

Screenshots

Environment information

  • Cordova CLI version
  • Cordova platform version
    • android 8.1.0
  • Dev machine OS and version, e.g.
    • OSX
      • 10.15.3

Related code:
The issue is specifically in after_prepare.js line #131:

if($resources.color && $resources.color._text) {

As $resources.color is an array, $resources.color._text is always undefined/false.

Other information:

Issue was introduced as part of: #284

@dpa99c dpa99c added android Relates to Android platform bug Something isn't working properly labels Jun 25, 2020
@dpa99c dpa99c closed this as completed in 62d5db2 Jun 26, 2020
dpa99c added a commit that referenced this issue Jun 26, 2020
…iple existing `<color>` to prevent overwriting the existing values. Resolves #436.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Relates to Android platform bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

2 participants