As ChilliSource is a source engine, each target platform needs to be built using the appropriate IDE: Windows must be built from Visual Studio; iOS builds must be built from Xcode; and Android must be built from Android Studio. The following describes how to setup and build a project for each platform using their respective IDE.
Windows
- From within your project navigate to Projects/Windows, then open the Visual Studio solution file (.sln)
- If prompted with a security warning accept both the ChilliSource project and your project
- Ensure your project is set as the startup project rather than Chilli Source – it should be bold. If not, right click on the solution in the Solution explorer and select Properties, then select your project in the “Single Startup Project” drop down menu
- Build the project by pressing the Local Windows Debugger button with the green play arrow
iOS
- From within your project navigate to Projects/iOS, then open the Xcode project file (.xcodeproj)
- Ensure your project target is selected rather than ChilliSource
- Build and run the project
Android
- Open Android Studio. Select Open Existing Project, navigate to Projects/Android/ inside your project then select the directory with your project name
- Wait for Android Studio to build the Gradle scripts. While it’s building it will say so on the bar at the bottom of the app. You can also open the Gradle console on the bottom right to see more detailed progress
- Open the project panel on the top left. open the local.properties file in Gradle Scripts. Add a new property called ndk.dir and set it to the location you have installed the NDK. On Windows make sure to use windows style paths and escape both the colon and backslash. For example:
Windows: ndk.dir=C\:\\Path\\android-ndk-r10e
OSX/Ubuntu: ndk.dir=/Path/android-ndk-r10e
- Open the Build Variant panel on the bottom left and select the build variant. This is a combination of the SKU (Google Play or Amazon), the target ABI (arm, armv7, or x86) and the build config (debug or release). Typically for development googlePlayArmv7Debug is a good choice
- Plug in a development device
- If you are building for Google Play you will need to separately build and push resources (everything inside Content/AppResources/) to device. To do this, open the Gradle tab on the top right. Navigate to “:app” then “installapkexpansion” and run the task for your build variant by double clicking it. Wait for the task to finish before progressing. This will need to be run every time resources are updated
- Press the green play button to build the project
- When prompted, select the device you want to run the app on from the list and press OK
Android Notes
- When building to device, make sure the screen is unlocked or the app will fail to run
- Your project should be cleaned after any build variant changes.
- The NDK on Windows has issues with long path names. Object files are built to C:/.CSTemp to mitigate this. It is safe to delete this directory, though your project will need a clean build.
- If you encounter the
fatal error: opening dependency file
compiler error on Windows, it may be because the path to your project or the NDK is too long. - Support for 64-bit builds (arm64 and x86_64) will be coming soon
- The native build pipeline will be updated and improved when native support is officially added to Android Studio
- Building from Eclipse is no longer supported
Where to Next?
Following the above instructions should be enough to build your project, though all you’ll get is a blank screen! The 3D Pong tutorial series is a good place to start learning how to develop a game in ChilliSource.