ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚑️
https://capacitorjs.com
MIT License
12.16k stars 1.01k forks source link

bug: Error: Parent folder doesn't exist #3794

Closed chaddd980 closed 3 years ago

chaddd980 commented 3 years ago

Bug Report

Capacitor Version

πŸ’Š   Capacitor Doctor  πŸ’Š

Latest Dependencies:

  @capacitor/cli: 2.4.2
  @capacitor/core: 2.4.2
  @capacitor/android: 2.4.2
  @capacitor/electron: 2.4.2
  @capacitor/ios: 2.4.2

Installed Dependencies:

  @capacitor/cli 2.4.2
  @capacitor/android 2.4.2
  @capacitor/core 2.4.2
  @capacitor/ios 2.4.2
  @capacitor/electron not installed

[success] Android looking great! πŸ‘Œ
  Found 9 Capacitor plugins for ios:
    capacitor-camera-preview (0.6.0)
    cordova-plugin-advanced-http (3.0.0)
    cordova-plugin-device (2.0.2)
    cordova-plugin-file (6.0.2)
    cordova-plugin-ionic-keyboard (2.2.0)
    cordova-plugin-ionic-webview (4.2.1)
    cordova-plugin-splashscreen (5.0.2)
    cordova-plugin-statusbar (2.4.2)
    cordova-plugin-whitelist (1.3.3)
[success] iOS looking great! πŸ‘Œ

Platform(s)

iOS

Current Behavior

When using FileSystem in ios, writeFile() gets an error "Parent folder doesn't exist" I found there was another issues about this with older version of capacitor/ios. The error seems to have returned

Expected Behavior

The file should be written with the path of the image

Code Reproduction

https://github.com/chaddd980/test

build for ios. Use web inspector to see logs. Click the take picture button. Take a picture and then click use photo. at that point the error will show up.

Other Technical Details

npm --version output: 1.9.3 node --version output: v12.13.1 pod --version output (iOS issues only): 1.9.3

Additional Context

jcesarmobile commented 3 years ago

Doesn’t look like you committed the changes that use the plugin

chaddd980 commented 3 years ago

Doesn’t look like you committed the changes that use the plugin

AH. You're right. Just fixed that. Thanks, you can check it out now

jcesarmobile commented 3 years ago

writeFile doesn't create intermediate directories by default, so you have to create test folder first, or use recursive: true option on writeFile

chaddd980 commented 3 years ago

writeFile doesn't create intermediate directories by default, so you have to create test folder first, or use recursive: true option on writeFile

Yes you're right. Thank You!

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.