Titanium SDK project configuration for native toolchain versioning
0 reputation · 08 Aug 2024, 14:21 UTC
0 reputation · 08 Aug 2024, 14:21 UTC
Appcelerator Titanium relies on a bridge layer to map JavaScript API calls to native platform implementations. The build process utilizes platform-specific toolchains, such as Xcode for iOS and Gradle for Android, to compile these binaries based on the settings defined in ti.app and ti.app-config.
When integrating custom native modules, there is a potential conflict between the SDK's automated project generation and the specific version requirements of the native toolchain. Because the Titanium CLI may overwrite direct modifications made within the native project files during subsequent builds, maintaining consistent environment constraints across a development team is critical.
What is the recommended method for locking the native toolchain version within the project configuration to prevent build failures caused by SDK version mismatches? Can these constraints be enforced globally via ti.app-config to ensure parity across different build environments?
33775 reputation · 09 Aug 2024, 02:21 UTC
The Titanium SDK does not expose a dedicated toolchainVersion property in ti.app-config. Native toolchain versions (Xcode for iOS, Android Gradle/SDK for Android) are implicitly determined by the installed SDK release. The primary method to lock these versions is to pin the SDK itself using the CLI command ti sdk use <version>. This ensures the CLI generates native project files against the matching platform toolchain for that SDK release.
ti --version) and the same SDK version to avoid mismatches.ti sdk list and note the version your project expects.ti sdk use <version> to pin the SDK and its associated toolchains.ti --version and confirm it matches across all environments.ti sdk use <version> to counteract auto-regeneration of native project files.Use comments to ask for clarification. Post a solution as an answer.
5,170 reputation · 09 Aug 2024, 00:53 UTC
The accepted answer correctly notes that pinning the SDK via ti sdk use binds the default toolchain. For stricter parity — especially when a project must stay on an older Xcode or NDK while the SDK supports newer ones — set explicit properties in tiapp.xml:
<property name="ios.xcode.version" type="string">15.2</property><property name="android.sdk.version" type="string">34</property><property name="android.ndk.version" type="string">26.1.10909125</property><property name="android.gradle.version" type="string">8.5</property> and android.gradle.plugin.versionThe CLI reads these during project generation and embeds them into the native build files, overriding its defaults. Property names are case-sensitive; typos are silently ignored and the CLI falls back to the latest installed toolchain. Cross-reference the SDK release notes for the supported Xcode/Android matrix before pinning versions outside the tested range. There is no ti.app-config file in standard Titanium projects — configuration lives in tiapp.xml (project) and ~/.titanium/config.json (user/global).