ionic-team / ionic-team/capacitor-assets

Unable to generate assets AppIcon-512@2x.png: unable to open for write

Open
#635 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
583
Forks
116
PR merge metrics
No merged PRs in 30d

Description

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/icon-20@2x.png'
Which doesn't make much sense, when I create a file with that name it just goes on to the next file 'icon-20@3x.png' and complains it doesn't exist. in order to test this i created an empty work folder and ran the following:
```bash
#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🙈

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the documented mkdir, npm install, and npx @capacitor/assets generate commands, focusing on the iOS output path and the ENOENT for Assets.xcassets/AppIcon.appiconset/icon-20@2x.png. Done means the command can generate the iOS assets in the empty test project without requiring placeholder files.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.