This lesson teaches you to
Troubleshooting
If you cannot build the ToDo Lite app, review the troubleshooting tips in this section.
Verify tool installations
If you can't build the ToDo Lite app, first make sure you have all the tools listed in Prepare your workstation installed and that you have the latest released version of each tool.
To verify that the command-line tools are installed and check version numbers, you can run the following commands in a terminal window:
$ git --version
$ brew -v
$ ios-sim --version
$ node -v
$ npm -v
$ phonegap -v
Troubleshooting SDKs
To make sure PhoneGap and your IDEs are set up correctly, try building the default PhoneGap app for iOS and Android:
$ phonegap create my-app
$ cd my-app
$ phonegap run ios
$ phonegap run android
For more information about setting up the SDKs on your computer, see:
Troubleshooting Other Problems
The following table contains solutions for some other problems you might encounter when building the ToDo Lite app:
| Problem | Solution |
|---|---|
| You can't install a command-line tool. | Use the sudo command to install the tool. For example: sudo npm install -g phonegap
|
| When you add plug-ins to your project, you get the following error message: [error] project directory could not be found. | Make sure you are in the /todo-lite directory. |
| When you build an iOS app, the iOS simulator doesn't start automatically. | Make sure ios-sim is installed. |
| When you build an Android app, it uses the remote environment and prompts you to log on to the PhoneGap build service. | Make sure your Android device emulator is set up. For more information about setting up an emulator, read the Deploy to Emulator section in the PhoneGap Android Platform Guide |
| When attempting to run the app for Android, you encounter the following error: [error] An error occurred during creation of android sub-project. | Ensure that the Android SDK tools and platform-tools directories are added to your system's PATH environment variable. |
Using Apache Cordova
If you cannot access the Couchbase Lite Plug-in for PhoneGap in the GitHub repository, you can use the Cordova download as an alternative. You can build apps with the Couchbase Lite Plug-in for PhoneGap by using Cordova instead of PhoneGap. The Couchbase Lite Plug-in for PhoneGap is listed on the Cordova Plugin Registry.
When using Cordova, you install the Couchbase Lite Plug-in for PhoneGap into your app by using the Cordova command-line tool.
To install Cordova on your computer:
$ npm install -g cordova
If you can't install Cordova with this command, try sudo npm install -g cordova instead.
To use Cordova to add the Couchbase Lite Plug-in for PhoneGap to your app:
$ cd your/project/directory
$ cordova local plugin add com.couchbase.lite.phonegap