Search code examples
cordovacordova-plugins

Cordova - issue adding plugins in iOS


I am getting some strange issue while adding plugin in iOS using CLI. Executed below commands in Terminal,

  1. cordova create Documents/Work/hello com.example.hello hello world
  2. cordova platform add ios
  3. cordova plugin add org.apache.cordova.device
  4. cordova build

But the build is failing & showing the below message,

error: no such file or directory: '/Users/gtmac/Documents/Work/hello/platforms/ios/helloworld/Plugins/org.apache.cordova.device/CDVDevice.m' clang: error: no input files

** BUILD FAILED **

When I add any plugin, .m & .h files are not getting copied to the Platforms/Plugins folder. But the files are present in the Plugins folder in the root directory.


Solution

  • There is this known issue with Cordova, where the build fails if the project's name has the first letter in lowercase. It has been reported back in 2014, but still not fixed, nor mentioned in the docs/no specification in the errors.

    So keep the app's project name starting with an uppercase.