No viable conversion from 'value_type' (aka 'std::string') to 'juce::File'

I am developing an audio application. I can run the codes on visual studios 2022 on my windows laptop but when i tried running on my mac using xcode, the error "No viable conversion from ‘value_type’ (aka ‘std::string’) to ‘juce::File’ "shows up, may i know how to fix this issue?

something like juce::File filepath = juce::String(trackPaths[rowNumber]) should do the trick.