简体   繁体   中英

Required cordova.js file not found. Cordova plugins will not function! Capacitor: FATAL ERROR

I updated my Ionic 2.5 App to Ionic 4.

The app was building on iOS as expected but when I ran it, it was throwing me this error: "Required cordova.js file not found. Cordova plugins will not function: Capacitor. FATAL ERROR".

I tried

  • removing all Cordova plugins
  • disabling angular buildOptimizer and optimization

After some struggle I figured out that the "public" folder wasn't present in the Xcode project. According to this article we must remove and re-add the public folder.

Apparently ionic builds the web and scripts into www folder and then copies them to iOS/App/App/public folder. Since the files weren't in that folder the app wasn't able to process those riles.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM