# Creating a New Titanium Module
This guide details the module creation process inside Appcelerator Studio. For more information on what methods and properties are available as part of the module API and specific platform notes, see the Android Module Development Guide and iOS Module Development Guide.
# Preparing Appcelerator Studio for Module Creation
If you are going to be creating Android modules, you will need to install Java support inside Appcelerator Studio. See Installing the Java Development Tools for the brief steps if you have not already done so.
# For Android Module Development
You will need to install the Android NDK. Download the appropriate .zip file from http://developer.android.com/sdk/ndk/index.html (opens new window) and extract it to some location on disk. Remember this location.
❗️ Warning
As an additional note, you need to make sure the path to your Studio workspace does not contain spaces. See Switching your Workspace for how to switch your workspace location. You can then import your projects from the old to the new workspace. This is a limitation of the Android NDK
# Creating a New Module
Creating a new module is accomplished by running through a wizard. Below summarizes the properties required, and a description of the values.
Property | Description/Purpose |
moduleid | This is a read-only module id of your module that is generated when you created your project. You should not edit this value. |
version | This is the version of your module. You should change this value each time you make major changes and distribute them. Version should be in the dotted notation (X.Y.Z) and must not con-tain any spaces or non-number characters. |
description | This is a human-readable description of your module. It should be short and suitable for display next to your module name. |
author | This is a human-readable author name you want to display next to your module. It can simply be your personal name or an organizational name such as "Appcelerator". |
license | This is a human-readable name of your license. You should use a short description such as "Apache Public License" or "Commercial". |
copyright | This is a human-readable copyright string for your module. For example, "Copyright (c) 2010 by Appcelerator, Inc." |
# Module Creation Steps
Open File > New > Mobile Module Project.
Choose a project name, a module ID, and a deployment target (native platform).
Click Next.
Fill out the remainder of the items on the next page.
Click Finish.
Your module is created. Note the two different folder structures, depending on the platform.
⚠️ Warning
You may need to refresh your project to show missing files. See related ticket http://jira.appcelerator.org/browse/TISTUD-948 (opens new window). For Android, you may also need to manually add JARs to your build path. See related ticket http://jira.appcelerator.org/browse/TIMOB-6839 (opens new window) for the workaround.
# Building/Packaging a Module
Choose Deploy > Package - iOS Module or Package - Android Module.
You may then choose to deploy the module for all projects, or for a specific project. This follows the installation rules as noted in Using Titanium Modules, though to summarize:
For all projects: the module .zip file is dropped at the root of the the Titanium SDK installation location.
For a particular project: The module .zip file is dropped at the root of your project.
# Troubleshooting Build Errors
# Your Android application project path contains spaces
[exec] Android NDK: Your Android application project path contains spaces: '/Users/username/Documents/Aptana Studio 3 Workspace/testModule/build/generated'
[exec] Android NDK: The Android NDK build cannot work here. Please move your project to a different location.
[exec] /Users/username/Documents/android-ndk-r7/build/core/build-local.mk:109: *** Android NDK: Aborting. . Stop.
You need to change your Studio workspace to not have spaces in the path. See the top of the page for information on how to do that.
# Android.ndk property is not set
BUILD FAILED
/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/module/android/build.xml:192: The following error occurred while executing this line:
/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/module/android/build.xml:175: Neither the ANDROID_NDK environment variable, or the android.ndk property is not set to an existing Android NDK installation (check your module's build.properties)
If you see this, you need to add android.ndk to the build.properties file. Set it to the path where you installed the NDK to begin with.
# Using Your Module
Follow the instructions in Using Titanium Modules for more information.