Unable to generate assets [email protected]: unable to open for write
I tried generating assets for my existing project but got an error: Unable to generate assets ENOENT: no such file or directory, lstat '/Users/java/development/store-app_claes-distribution/ios/App/App/Assets.xcassets/AppIcon.appiconset/[email protected]' Which doesn't make much sense, when I create a file with that name it just goes on to the next file '[email protected]' and complains it doesn't exist. in order to test this i created an empty work folder and ran the following:
#create test folder and install '@capacitor/assets'
mkdir test-resource
cd test-resource
npm install @capacitor/assets --save-dev
mkdir assets
# import my assets from project (icon.png, splash.png and splash-dark.png)
cp ~/development/store-app_claes-distribution/resources/* ./assets
# create /ios/App folder to mitigate complaints
mkdir ./ios && mkdir ./ios/App
# try to generate assets
npx @capacitor/assets generate --iconBackgroundColor '#ffffff' --iconBackgroundColorDark '#1a1a1a' --splashBackgroundColor '#ffffff' --splashBackgroundColorDark '#1a1a1a' --ios
running the above code will result in the error mentioned in the title which is bizarre? It seems to be unable to create files, only updates them but then deletes these files anyway.
If I'm obviously stupid please point that out because it might be ... I'm pulling my hair out on this one🙈
Did you ever find a solution? I'm running into the same error.
Slight difference in approach: I run npx cap add ios to ensure capacitor-assets is interacting with a known file structure.
Then, I run npx capacitor-assets generate... and run into the same issue.
@foleyautomated nope the ionic team doesn't care, I ended up writing a basic implementation myself using in javascript using sharp for the image manipulation, It's very basic but if you are still looking for a one off solution you can use it jamievangeysel/app-icon-generator
There's a repetitive folder structure generated by Capacitor.
ios/App/App/Assets.xcassets
and the capacitor-assets expects it to be ios/App/Assets.xcassets – and fails when that is not found.
You could symlink or copy paste folders around, but yes - this is an odd bug.