Before you upgrade
Before upgrading your NDK version:- Review the changelog - Check the changelog for the target version to understand what has changed
- Check for breaking changes - Look for any breaking changes that might affect your application
- Test in a development environment - Never upgrade directly in production
- Verify supported versions - Ensure the target version is currently supported
General upgrade process
For Android Gradle Plugin projects
-
Update the
android.ndkVersionproperty in yourbuild.gradleorbuild.gradle.ktsfile: - Sync your project with Gradle files
- Clean and rebuild your project
- Run your test suite to verify functionality
For standalone NDK installations
- Download the new NDK version from the official downloads page
- Extract the NDK to your desired location
- Update your environment variables or IDE settings to point to the new NDK location
- Clean and rebuild your project
- Run your test suite to verify functionality
Version-specific migration guides
Migrating to NDK r29
Migrating to NDK r29
Key changes in r29
For detailed information about changes in NDK r29, refer to the official release notes.Common migration tasks
- Review toolchain version changes and compiler warnings
- Check for new API availability if targeting newer Android versions
- Update build scripts if using deprecated features
- Test thoroughly on all target ABIs
Breaking changes
Consult the official changelog for any breaking changes in this release.Migrating to NDK r28
Migrating to NDK r28
Key changes in r28
For detailed information about changes in NDK r28, refer to the official release notes.Common migration tasks
- Review toolchain version changes and compiler warnings
- Check for new API availability if targeting newer Android versions
- Update build scripts if using deprecated features
- Test thoroughly on all target ABIs
Breaking changes
Consult the official changelog for any breaking changes in this release.Migrating to NDK r27
Migrating to NDK r27
Key changes in r27
For detailed information about changes in NDK r27, refer to the official release notes.Common migration tasks
- Review toolchain version changes and compiler warnings
- Check for new API availability if targeting newer Android versions
- Update build scripts if using deprecated features
- Test thoroughly on all target ABIs
Breaking changes
Consult the official changelog for any breaking changes in this release.Handling breaking changes
Toolchain changes
Newer versions of Clang/LLVM may:- Introduce new warnings or errors for previously accepted code
- Change optimization behavior
- Add new sanitizers or security features
- Review compiler warnings carefully
- Update code to address legitimate issues
- Use compiler flags to suppress false positives (as a last resort)
Dynamic linker changes
Changes to Android’s dynamic linker can affect how shared libraries are loaded. For detailed information, see: Common issues include:- Missing symbol errors
- Library loading failures
- Changed behavior for
dlopen()
API level changes
When upgrading the NDK, you may want to target newer Android API levels. Check:- Android bionic status - API availability by Android version
- NDK API Reference - Complete API documentation
Upgrade paths
Skipping versions
If you’re upgrading from an older NDK to a much newer version (e.g., r25 to r29):- Review the changelogs for all intermediate versions
- Pay special attention to deprecated features that have been removed
- Consider upgrading incrementally if you encounter issues
Rollback strategy
Always maintain the ability to rollback:- Keep your previous NDK installation until the upgrade is verified
- Use version control to track changes
- Document any build configuration changes
Common migration issues
Build failures
If your build fails after upgrading:- Check the common problems page
- Review compiler errors and warnings
- Verify that all dependencies are compatible with the new NDK
Runtime issues
If your application crashes or behaves incorrectly after upgrading:- Check for ABI compatibility issues
- Review crash dumps and tombstones
- Use debugging tools to identify the root cause
Performance regressions
If you notice performance changes:- Profile your application with both NDK versions
- Review toolchain optimization changes
- Check for unintended behavior changes in your code
Getting help
If you encounter issues during migration:- Check the NDK wiki for release-specific guidance
- Review the common problems page
- Ask questions on the android-ndk Google Group
- File bugs at github.com/android-ndk/ndk/issues
Related resources
- NDK releases - Supported versions and download information
- Changelog - Detailed changes in each release
- NDK Roadmap - Future NDK direction
- Build System Maintainers Guide - For custom build system integration