Skip to content

Commit 247f30d

Browse files
authored
[Android] Update docs for new NDK r12
The latest Android NDK is r12, update the docs to reflect this. I've tested the build and can confirm that it works with the new NDK.
1 parent d83db61 commit 247f30d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/Android.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To follow along with this guide, you'll need:
3434
The stdlib is currently only buildable for Android from a Linux environment.
3535
Before attempting to build for Android, please make sure you are able to build
3636
for Linux by following the instructions in the Swift project README.
37-
2. The latest version of the Android NDK (r11c at the time of this writing),
37+
2. The latest version of the Android NDK (r12 at the time of this writing),
3838
available to download here:
3939
http://developer.android.com/ndk/downloads/index.html.
4040
3. An Android device with remote debugging enabled. We require remote
@@ -52,7 +52,7 @@ the Swift stdlib for Android requires the libiconv and libicu libraries.
5252
However, you'll need versions of these libraries that work on Android devices.
5353

5454
You may download prebuilt copies of these dependencies, built for Ubuntu 15.10
55-
and Android NDK r11c. Click [here](https://github.com/SwiftAndroid/libiconv-libicu-android/releases/download/android-ndk-r11c/libiconv-libicu-armeabi-v7a-ubuntu-15.10-ndk-r11c.tar.gz)
55+
and Android NDK r12. Click [here](https://github.com/SwiftAndroid/libiconv-libicu-android/releases/download/android-ndk-r12/libiconv-libicu-armeabi-v7a-ubuntu-15.10-ndk-r12.tar.gz)
5656
to download, then unzip the archive file.
5757

5858
Alternatively, you may choose to build libiconv and libicu for Android yourself:
@@ -81,7 +81,7 @@ Android NDK, as well as the directories that contain the `libicuuc.so` and
8181
$ utils/build-script \
8282
-R \ # Build in ReleaseAssert mode.
8383
--android \ # Build for Android.
84-
--android-ndk /path/to/android-ndk-r11c \ # Path to an Android NDK.
84+
--android-ndk /path/to/android-ndk-r12 \ # Path to an Android NDK.
8585
--android-api-level 21 \ # The Android API level to target. Swift only supports 21 or greater.
8686
--android-icu-uc /path/to/libicu-android/armeabi-v7a \
8787
--android-icu-uc-include /path/to/libicu-android/armeabi-v7a/icu/source/common \
@@ -102,7 +102,7 @@ gold linker in the Android NDK into your `PATH`:
102102

103103
```
104104
$ sudo ln -s \
105-
/path/to/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin/ld.gold \
105+
/path/to/android-ndk-r12/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin/ld.gold \
106106
/usr/bin/armv7-none-linux-androideabi-ld.gold
107107
```
108108

@@ -112,9 +112,9 @@ source file, targeting Android:
112112
```
113113
$ build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc \ # The Swift compiler built in the previous step.
114114
-target armv7-none-linux-androideabi \ # Targeting android-armv7.
115-
-sdk /path/to/android-ndk-r11c/platforms/android-21/arch-arm \ # Use the same NDK path and API version as you used to build the stdlib in the previous step.
116-
-L /path/to/android-ndk-r11c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \ # Link the Android NDK's libc++ and libgcc.
117-
-L /path/to/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9 \
115+
-sdk /path/to/android-ndk-r12/platforms/android-21/arch-arm \ # Use the same NDK path and API version as you used to build the stdlib in the previous step.
116+
-L /path/to/android-ndk-r12/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \ # Link the Android NDK's libc++ and libgcc.
117+
-L /path/to/android-ndk-r12/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9 \
118118
hello.swift
119119
```
120120

@@ -148,7 +148,7 @@ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswi
148148
In addition, you'll also need to copy the Android NDK's libc++:
149149

150150
```
151-
$ adb push /path/to/android-ndk-r11c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so /data/local/tmp
151+
$ adb push /path/to/android-ndk-r12/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so /data/local/tmp
152152
```
153153

154154
Finally, you'll need to copy the `hello` executable you built in the
@@ -192,7 +192,7 @@ $ utils/build-script \
192192
-T \ # Run all tests.
193193
--android \ # Build for Android.
194194
--android-deploy-device-path /data/local/tmp \ # Temporary directory on the device where Android tests are run.
195-
--android-ndk ~/android-ndk-r10e \ # Path to an Android NDK.
195+
--android-ndk ~/android-ndk-r12 \ # Path to an Android NDK.
196196
--android-ndk-version 21 \
197197
--android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
198198
--android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \

0 commit comments

Comments
 (0)