Please install Android target
Last Update:2016-11-19
Source: Internet
Author: User
<span id="Label3"></p><pre><span style="color: #000000">the <span style="color: #000000">following error occurred today while executing ionic build android: [error:please</span></span><span style="color: #0000ff"><span style="color: #0000ff">Install</span></span>Android target:<span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #800000"><span style="color: #800000">android-22</span></span><span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #000000"><span style="color: #000000">. Hint:open the SDK Manager by running:d:\program\ files\ (x86) \android\android</span></span>-<span style="color: #000000"><span style="color: #000000">Sdk\tools\android. Batyou would require:</span></span><span style="color: #800080"><span style="color: #800080">1</span></span>.<span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #800000"><span style="color: #800000">SDK Platform</span></span><span style="color: #800000"><span style="color: #800000">"</span></span> <span style="color: #0000ff"><span style="color: #0000ff"></span> for</span>android-<span style="color: #800080"><span style="color: #800080"></span> a</span><span style="color: #800080"><span style="color: #800080">2</span></span>.<span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #800000"><span style="color: #800000">Android SDK platform-tools (latest)</span></span><span style="color: #800080"><span style="color: #800080">3</span></span>.<span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #800000"><span style="color: #800000">Android SDK build-tools</span></span><span style="color: #800000"><span style="color: #800000">"</span></span><span style="color: #000000"><span style="color: #000000">(latest)] ERROR Building one of the Platforms:Error:cmd:Command failed with exit code</span></span><span style="color: #800080"><span style="color: #800080">2</span></span><span style="color: #000000"><span style="color: #000000">required environment or OS to build this projectError:cmd:Command failed with exit code</span></span><span style="color: #800080"><span style="color: #800080">2</span></span><span style="color: #000000"><span style="color: #000000">error reason: the target platform version in the project Properties profile is Inconsistent. Workaround:</span></span><span style="color: #800080"><span style="color: #800080">1</span></span>To ensure that the system has installed the API for the target platform</pre><p><p></p></p><pre><pre><span style="color: #008000">//</span> <span style="color: #008000">Modify the following 3 files in the folder where the project is located to ensure that the target platform version is consistent, such as:</span> <span style="color: #008000">//</span> <span style="color: #008000"># Project Target.</span> <span style="color: #008000">//</span> <span style="color: #008000">target=android-22</span>Myapp/platforms/android/<span style="color: #000000">project.properties myApp</span>/platforms/android/ cordovalib/<span style="color: #000000">project.propertiesmyapp</span>/platforms/android/cordovalib/<span style="color: #000000">androidmanifest.xml</span><span style="color: #008000">// </span> <span style="color: #008000">androidmanifest.xml file modified as follows</span> <USES-SDK android:minsdkversion=<span style="color: #800000">"</span><span style="color: #800000"></span><span style="color: #800000"> </span>android:targetsdkversion=<span style="color: #800000">"</span><span style="color: #800000"></span><span style="color: #800000"></span> />"</pre></pre><p><p></p></p><p><p> Install Android target </p> </p></span>