AlexDisler / cordova-icon

Automatic icon resizing for Cordova
MIT License
689 stars 292 forks source link

compatibility with Cordova 7.0 #99

Closed mesqueeb closed 6 years ago

mesqueeb commented 7 years ago

Now it doesn't work on 7.0.

mprins commented 6 years ago

a quick fix is to change the part around line 69 of index.js to something like this (YMMV):

  platforms.push({
    name : 'android',
    isAdded : fs.existsSync('platforms/android'),
    // quick fix voor https://github.com/AlexDisler/cordova-icon/issues/99
    //iconsPath : 'platforms/android/res/',
    iconsPath : 'platforms/android/app/src/main/res/',
    icons : [
      /* { name : 'drawable/icon.png',       size : 96 },
      { name : 'drawable-hdpi/icon.png',  size : 72 },
      { name : 'drawable-ldpi/icon.png',  size : 36 },
      { name : 'drawable-mdpi/icon.png',  size : 48 },
      { name : 'drawable-xhdpi/icon.png', size : 96 },
      { name : 'drawable-xxhdpi/icon.png', size : 144 },
      { name : 'drawable-xxxhdpi/icon.png', size : 192 },
      */
      { name : 'mipmap-hdpi/icon.png',  size : 72 },
      { name : 'mipmap-ldpi/icon.png',  size : 36 },
      { name : 'mipmap-mdpi/icon.png',  size : 48 },
      { name : 'mipmap-xhdpi/icon.png', size : 96 },
      { name : 'mipmap-xxhdpi/icon.png', size : 144 },
      { name : 'mipmap-xxxhdpi/icon.png', size : 192 }
    ]
  });
ccorcos commented 6 years ago

Feel free to use my fork. Just add this to your package.json

"cordova-icon": "git://github.com/ccorcos/cordova-icon.git#2f309add525ceebbd7f28c0ed01178ea7c6ed011",
mesqueeb commented 6 years ago

@AlexDisler Did you close this issue because I should use @ccorcos fork to use your repository with Cordova 7? Or did you close this issue because you made a new version that supports Cordova 7 yourself?

AlexDisler commented 6 years ago

I've added support for cordova 7. You can try to reinstall or you can try the fork. Both should work.

mesqueeb commented 6 years ago

@AlexDisler Thank you very much. I see that you have commited version 1.0 to the master branch, but when I check the "releases" it's still at v.0.9.2 (on 24 Jan 2017).

Does this mean we have to wait until you release v.1.0 before we can use it with npm install ? Or is there a way we can already npm install cordova-icon with the latest commit you made, even though it's not available in the "releases" ?

mprins commented 6 years ago

@mesqueeb npmjs has 1.0.0 https://www.npmjs.com/package/cordova-icon

mesqueeb commented 6 years ago

@mprins Oh great! Thanks for letting me know!! @AlexDisler will you also make an official 1.0 release in "releases" ?