Deploy website

Deploy website version based on c06e54d76f098175ba996e65af70d66b5e2aafbe
This commit is contained in:
Website Deployment Script
2019-01-26 16:10:53 +00:00
parent 8236025f12
commit 4ce07773ce
220 changed files with 1760 additions and 1760 deletions
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+11 -11
View File
@@ -39,9 +39,9 @@
<p>Assuming you have the Android SDK installed, run <code>android</code> to open the Android SDK Manager.</p>
<p>Make sure you have the following installed:</p>
<ol>
<li>Android SDK version 26 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 26.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository &gt;= 26 (for Android Support Library)</li>
<li>Android SDK version 28 (compileSdkVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>SDK build tools version 28.0.3 (buildToolsVersion in <a href="https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle"><code>build.gradle</code></a>)</li>
<li>Android Support Repository 28 (for Android Support Library)</li>
<li>Android NDK (download links and installation instructions below)</li>
</ol>
<h4><a class="anchor" aria-hidden="true" id="point-gradle-to-your-android-sdk"></a><a href="#point-gradle-to-your-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Point Gradle to your Android SDK:</h4>
@@ -54,19 +54,19 @@
</ul>
<p>Example:</p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_SDK</span>=/Users/your_unix_name/android-sdk-macosx
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r10e
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_NDK</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<p><strong>Step 2:</strong> Create a <code>local.properties</code> file in the <code>android</code> directory of your react-native app with the following contents:</p>
<p>Example:</p>
<pre><code class="hljs">sdk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-sdk-macosx
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17b
ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/android-ndk-r17c
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="download-links-for-android-ndk"></a><a href="#download-links-for-android-ndk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Download links for Android NDK</h4>
<ol>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17b-windows-x86.zip</a></li>
<li>Mac OS (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip</a></li>
<li>Linux (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip</a></li>
<li>Windows (64-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86_64.zip</a></li>
<li>Windows (32-bit) - <a href="http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip">http://dl.google.com/android/repository/android-ndk-r17c-windows-x86.zip</a></li>
</ol>
<p>You can find further instructions on the <a href="https://developer.android.com/ndk/index.html">official page</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="building-the-source"></a><a href="#building-the-source" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building the source</h3>
@@ -79,8 +79,8 @@ ndk.<span class="hljs-attribute">dir</span>=/Users/your_unix_name/android-ndk/an
<p>Add <code>gradle-download-task</code> as dependency in <code>android/build.gradle</code>:</p>
<pre><code class="hljs css language-gradle">...
<span class="hljs-keyword">dependencies</span> {
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.1.4'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.1.2'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'com.android.tools.build:gradle:3.2.1'</span>
<span class="hljs-keyword">classpath</span> <span class="hljs-string">'de.undercouch:gradle-download-task:3.4.3'</span>
<span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> Do not place your application dependencies here; they belong</span>
<span class="hljs-comment">// in the individual module build.gradle files</span>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
+5 -5
View File
@@ -260,7 +260,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<h4><a class="anchor" aria-hidden="true" id="2-install-the-android-sdk"></a><a href="#2-install-the-android-sdk" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>2. Install the Android SDK</h4>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 8.1 (Oreo)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the &quot;Welcome to Android Studio&quot; screen. Click on &quot;Configure&quot;, then select &quot;SDK Manager&quot;.</p>
<p><block class="native mac android" /></p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
@@ -270,12 +270,12 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio &quot;Preferences&quot; dialog, under <strong>Appearance &amp; Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 8.1 (Oreo)</code> entry, then make sure the following items are checked:</p>
<p>Select the &quot;SDK Platforms&quot; tab from within the SDK Manager, then check the box next to &quot;Show Package Details&quot; in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 27</code></li>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>27.0.3</code> is selected.</p>
<p>Next, select the &quot;SDK Tools&quot; tab and check the box next to &quot;Show Package Details&quot; here as well. Look for and expand the &quot;Android SDK Build-Tools&quot; entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click &quot;Apply&quot; to download and install the Android SDK and related build tools.</p>
<h4><a class="anchor" aria-hidden="true" id="3-configure-the-android-home-environment-variable"></a><a href="#3-configure-the-android-home-environment-variable" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>3. Configure the ANDROID_HOME environment variable</h4>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
@@ -343,7 +343,7 @@ npm start <span class="hljs-comment">#you can also use: expo start</span>
<h3><a class="anchor" aria-hidden="true" id="using-a-virtual-device"></a><a href="#using-a-virtual-device" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using a virtual device</h3>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the &quot;AVD Manager&quot; from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/react-native/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Oreo</strong> API Level 27 image.</p>
<p>If you have just installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select &quot;Create Virtual Device...&quot;, then pick any Phone from the list and click &quot;Next&quot;, then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>

Some files were not shown because too many files have changed in this diff Show More