无法在Android上制作Cordova WebView [英] Unable to make a Cordova WebView on Android

查看:94
本文介绍了无法在Android上制作Cordova WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在此处进行操作设置一个Android WebView,但我无法越过下面的步骤#2:

I'm following the instructions here to setup an Android WebView but I cannot get past step #2 below:



  1. 导航至Android包的/ framework目录,并运行ant
    jar。它会创建Cordova .jar文件,格式为
    / framework / cordova-xxxjar。


正在运行的蚂蚁返回错误:

Running ant returns an error:

build.xml:42: You need to create the file 'local.properties' by running 'android update project -p .' here.

如何克服这个问题?

推荐答案


  1. 如果您已下载Android SDK并添加到了path变量中,则必须选择要使用的android版本。您的系统可以执行以下操作:

  1. You will have to choose the version of android you want to use, if you have downloaded the Android SDK and added to the path variable of your system you can do this:

android list targets

它将给您这样的答案:

Available Android targets:
----------
id: 1 or "android-8"
Name: Android 2.2
Type: Platform
API level: 8
Revision: 3
Skins: WQVGA432, QVGA, WQVGA400, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi
----------
id: 2 or "android-17"
Name: Android 4.2.2
Type: Platform
API level: 17
Revision: 2
Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi-v7a, x86
----------
id: 3 or "Google Inc.:Google APIs:17"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 4.2.2 (API level 17)
Libraries:
* com.google.android.media.effects (effects.jar)
  Collection of video effects
* com.android.future.usb.accessory (usb.jar)
  API for USB Accessories
* com.google.android.maps (maps.jar)
  API for Google Maps
Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA800 (default), QVGA, WXGA800
ABIs : armeabi-v7a
----------
id: 4 or "android-19"
Name: Android 4.4
Type: Platform
API level: 19
Revision: 1
Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi-v7a


  • 我选择了我拥有的最高的

  • I choose the highest one i have so I did:

    android update project -p . -t android-19
    


  • 最后

  • And finally

    ant jar
    

    结果类似:

    jar:
    [jar] Building jar: C:\Users\Daniele\Desktop\cordova-android\framework\cor
    dova-3.5.1.jar
    
    BUILD SUCCESSFUL
    Total time: 11 seconds
    


  • 现在您已经有了罐子。
    (更详细的解释可以在 cordova-2.7.0.jar在哪里?

    Now you've got your jar. (A more detailed explanation can be found at Where is cordova-2.7.0.jar?)

    这篇关于无法在Android上制作Cordova WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆