zhanghai / AndroidSVGScripts

Bash scripts to automate and extend the process of using SVG as Android image asset
56 stars 10 forks source link

Using it on Mac OS X ( El-Capitan) #1

Closed laaptu closed 8 years ago

laaptu commented 8 years ago

To use this on Mac os x , I have done the following

  1. Using calc instead of gcalccmd(http://brewformulas.org/Calc)
  2. Using inkscape-bin instead of inscape, found on /Applications/Inkscape.app/Contents/Resources/bin/

While working with sample folder, I get following error

** (inkscape-bin:6730): WARNING **: Error: Could not open file 'drawable-mdpi/window_background_statusbar_toolbar_tab.9.svg' with VFS ** (inkscape-bin:6730): WARNING **: Specified document drawable-mdpi/window_background_statusbar_toolbar_tab.9.svg cannot be opened (does not exist or not a valid SVG file) bash: fork: Resource temporarily unavailable

Is there any way to make it work on Mac OS X? Thanks

zhanghai commented 8 years ago

Seems that inkscape failed to find the generated svg file. Don't know what the problem is - if the script failed beforehand in generating svg, is there any error message about it? Or you can comment out the rm "${dir}/${name}.svg" line to see if any svg is successfully generated.

laaptu commented 8 years ago

@DreaminginCodeZH : The svg files are generated.Seems like it is the error of inkscape (but not sure). Whenever I run the script the first thing it comes is bash: fork: Resource temporarily unavailable. And I have commented rm "${dir}/${name}.svg". Please look upon the attached screenshot of console log screen shot 2015-11-16 at 3 24 05 pm

laaptu commented 8 years ago

@DreaminginCodeZH : Seems like it is the issue related to inkscape on Mac os x. The svg file generated by above method ,when I tried to load using inkscape-bin, it gives error. Attached is the error log while trying to open the file using inkscape-bin -f filename.svg log.txt

zhanghai commented 8 years ago

Oops. Perhaps you should cd sample and then ./gen-png.sh. I forgot to make that safe.

As for the fork EAGAIN, maybe it is an OSX-specific issue? I've never used OSX so I cannot provide more help than man and Google.

As in man 2 fork:

ERRORS
       EAGAIN

              A system-imposed limit on the number of threads was encountered.  There are a number of limits that may trigger this error: the RLIMIT_NPROC soft resource limit (set via setrlimit(2)),  which
              limits  the  number  of processes and threads for a real user ID, was reached; the kernel's system-wide limit on the number of processes and threads, /proc/sys/kernel/threads-max, was reached
              (see proc(5)); or the maximum number of PIDs, /proc/sys/kernel/pid_max, was reached (see proc(5)).

       EAGAIN The caller is operating under the SCHED_DEADLINE scheduling policy and does not have the reset-on-fork flag set.  See sched(7).
laaptu commented 8 years ago

@DreaminginCodeZH : Yes you are right. I believe it is related to OS X and inkscape. So for right now , I will work this on Ubuntu. Thanks for the useful tool.