Troubleshooting Development Work - adapt-it/adapt-it-mobile GitHub Wiki
This wiki page is meant as a holding place for troubleshooting your development work. If you run across a gotcha that you've managed to resolve, post the issue and how to address it here.
Attempting to create a platform via the cordova platforms add
command result in an error similar to the following:
$ cordova platform add android
{ [Error: ENOENT, no such file or directory '.../adapt-it-mobile/plugins/android.json']
errno: 34,
code: 'ENOENT',
path: '.../adapt-it-mobile/plugins/android.json',
syscall: 'open'
This could be due to a missing plugins subdirectory within the adapt-it-mobile project. To solve this, create a directory named "plugins" under adapt-it-mobile and make the call to cordova platforms add <platform>
again.
When compiling via the command line (cordova build ios
for example), a compilation error occurs in events.js similar to the following:
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Mike was able to fix this by deleting and rebuilding the platform. For iOS, the commands were as follows:
cordova platform remove ios
cordova platform add ios
cordova build ios
The iOS platform of the project will compile fine from the OSX terminal, but generates "missing header" errors when you attempt to compile it from within Xcode.
If you have compilation problems related to missing headers, the build products should build into the same build directory. You may need to set the preference "Xcode Preferences -> Locations -> Derived Data -> Advanced…" to "Unique". This is the default setting for Xcode on a fresh new install, if you upgraded from older versions of Xcode, you might have a legacy preference in there that you need to update.
When opening index.html in Google Chrome, you're greeted with a grey blank screen. If you right-mouse click and select Inspect Element, you'll note that there are 3 security-related exceptions being thrown.
- Open index.html in another browser -- Safari or Firefox, for example.
- Open Chrome with the flag "--allow-file-access-from-files". This can be done by right-mouse clicking on the Google Chrome icon (Windows) > selecting Properties > clicking the Shortcut tab > adding --allow-file-access-from-files to the Target field > clicking Apply > relaunching Chrome > re-opening index.html (or dragging index.html into the open Chrome browser window).