Cordova错误请安装Android目标19

时间:2015-03-24 01:05:40

标签: android cordova

我的科尔多瓦突然停止了工作。

当我上次工作时 - 大约2个月前,它运作良好。

现在,当我想继续处理我的项目时,它给了我错误:

> cordova platforms add android
npm http GET https://registry.npmjs.org/cordova-android/3.7.1
npm http 200 https://registry.npmjs.org/cordova-android/3.7.1
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-3.7.1.tgz
npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-3.7.1.tgz
Platform android already added.


> cordova run android
Running command: C:\Work\Eclipse\Workspace\Android\CordovaTmp\HelloWorld\platforms\android\cordova\run.bat
"C:\Work\Eclipse\Workspace\Android\CordovaTmp\HelloWorld\platforms\android\cordova\run"
ERROR: Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
ERROR running one or more of the platforms: Error: C:\Work\Eclipse\Workspace\Android\CordovaTmp\HelloWorld\platforms\android\cordova\run.bat: Command failed with exit code 2
You may not have the required environment or OS to run this project


> cordova -version
4.3.0

我已查看过这些帖子,但没有帮助:link 1link 2link 3

另外,即使我在“我的电脑”中为我的PATH变量添加了工具和平台工具,我也无法在cygwin shell上运行'android'

我正在运行Windows 8.1,cygwin,这就是我的SDK Manager的样子: enter image description here

我的平台/ android / AndroidManifest.xml看起来像:

<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.foo.helloworld" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
</manifest>

1 个答案:

答案 0 :(得分:1)

cordova run android命令需要从windows powershell而不是cygwin运行。