@@ -34,7 +34,7 @@ To follow along with this guide, you'll need:
34
34
The stdlib is currently only buildable for Android from a Linux environment.
35
35
Before attempting to build for Android, please make sure you are able to build
36
36
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),
38
38
available to download here:
39
39
http://developer.android.com/ndk/downloads/index.html .
40
40
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.
52
52
However, you'll need versions of these libraries that work on Android devices.
53
53
54
54
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 )
56
56
to download, then unzip the archive file.
57
57
58
58
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
81
81
$ utils/build-script \
82
82
-R \ # Build in ReleaseAssert mode.
83
83
--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.
85
85
--android-api-level 21 \ # The Android API level to target. Swift only supports 21 or greater.
86
86
--android-icu-uc /path/to/libicu-android/armeabi-v7a \
87
87
--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`:
102
102
103
103
```
104
104
$ 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 \
106
106
/usr/bin/armv7-none-linux-androideabi-ld.gold
107
107
```
108
108
@@ -112,9 +112,9 @@ source file, targeting Android:
112
112
```
113
113
$ build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc \ # The Swift compiler built in the previous step.
114
114
-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 \
118
118
hello.swift
119
119
```
120
120
@@ -148,7 +148,7 @@ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswi
148
148
In addition, you'll also need to copy the Android NDK's libc++:
149
149
150
150
```
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
152
152
```
153
153
154
154
Finally, you'll need to copy the ` hello ` executable you built in the
@@ -192,7 +192,7 @@ $ utils/build-script \
192
192
-T \ # Run all tests.
193
193
--android \ # Build for Android.
194
194
--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.
196
196
--android-ndk-version 21 \
197
197
--android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
198
198
--android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
0 commit comments