cordova-plugin-file icon indicating copy to clipboard operation
cordova-plugin-file copied to clipboard

fileEntry.file caused app crash on iOS simulator

Open spinybeast opened this issue 3 years ago • 0 comments

Bug Report

Problem

I record audio with Cordova-plugin-media and try to save it with Cordova-plugin-file. On real device (from TestFlight) it works correctly, but I need to run it on simulator. When I run my code on simulator, app crashes without any readable reason

What is expected to happen?

fileEntry.file works correctly on simulator and returns File object, like it does on real iPhone

What does actually happen?

simulator crashes, I can't debug my code

Command or Code

        // stop recording and save file
        mediaRec.stopRecord()
        mediaRec.release()

        window.requestFileSystem(window.LocalFileSystem.TEMPORARY, 0, (fileSystem) => {
          fileSystem.root.getFile(src, {}, (fileEntry) => {
           // next string causes crash
            fileEntry.file((file) => {
              changeHandler(file)
            })
          })

Environment, Platform, Device

iOS, MacBook Air 2020, Simulator iPhone SE 2020 (iOS 15)

Version information

Cordova: 10.0.0 Cordova-plugin-file: 6.0.2

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

spinybeast avatar Nov 18 '21 20:11 spinybeast