AlexDisler / cordova-icon

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

Project wont't compile after running cordova-icon #111

Closed herrmanno closed 6 years ago

herrmanno commented 6 years ago

After executing cordova-icon I am no longer able to build my android project. There seems to be a problem in cordova-icon creating the directory platforms/res/ which does not contain subdirectories xml, values etc.

What I've done:

node_modules/.bin/cordova --version
7.1.0

convert --version
Version: ImageMagick 7.0.7-8 Q16 x86_64 2017-10-26 http://www.imagemagick.org
Olivers-Mac-mini:quiz-web oliverherrmann$ node_modules/.bin/cordova-icon --icon=res/icon.png 

 Checking Project & Icon

  ✓  platforms found: ios, android
  ✓  res/icon.png exists
  ✓  config.xml exists

 Generating Icons for ios

  ✓  AppIcon40x40@2x.png created
 (...)
  ✓  icon-1024.png created

 Generating Icons for android

  ✓  drawable-ldpi/icon.png created
  (...)
  ✓  mipmap-xxxhdpi/icon.png created
Olivers-Mac-mini:quiz-web oliverherrmann$ node_modules/.bin/cordova run android
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/oliverherrmann/Dev/quiz-web/platforms/android/res/xml/config.xml

Parsing /Users/oliverherrmann/Dev/quiz-web/platforms/android/res/xml/config.xml failed
Error: ENOENT: no such file or directory, open '/Users/oliverherrmann/Dev/quiz-web/platforms/android/res/xml/config.xml'
Olivers-Mac-mini:quiz-web oliverherrmann$ 
pwqw commented 6 years ago

The problem is caused in cordova-android@7.0.0. Change the title for this more specific.

No-solution: downgrade to cordova-android@6.4.0.

tominou commented 6 years ago

Move platform/android/res to platforms/android/app/src/main/

dhananjaykumar880 commented 6 years ago

I agree with @tominou please update index.js of cordova-icon and cordova-splash android path with 'platforms/android/app/src/main/res/'

for now, I have changed in my installed package.

tominou commented 6 years ago

If you use cordova-android@7.0.0, you can install my fork: npm uninstall -g cordova-icon Then npm install -g tominou/cordova-icon

I also made a fork of cordova-splash in case you need: tominou/cordova-splash

AlexDisler commented 6 years ago

Please try the latest version, it should work now

humblecoder commented 6 years ago

Still not working for me. I'm currently on Cordova 8 though. icon compatibility seems like something that should remain steady. 🤔