简体   繁体   English

使用较旧的Android SDK版本安装cordova

[英]Installing cordova with older android SDK version

I have an android project build up on cordova 3.6.3. 我在cordova 3.6.3上建立了一个android项目。 I'm trying to upgrade it to 5.2.2 from scratch. 我正在尝试将其从头升级到5.2.2。 However, I have a problem with the android SDK. 但是,我对android SDK有问题。

The process I'm using is: 我正在使用的过程是:

cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add android --save
cordova build android

And what I receive is: 我收到的是:

Creating Cordova project for the Android platform: 为Android平台创建Cordova项目:

Path: platforms/android
Package: com.example.hello
Name: HelloWorld
Activity: MainActivity
Android target: android-23

So the Android target is the SDK23. 因此,Android目标是SDK23。 In my project I'm using some libraries such as org.apache.cordova.CordovaWebViewClient which have been deprecated since SDK 21. As a consequence I'm trying to create the cordova on SDK 20 and not on 23. 在我的项目中,我使用了自SDK 21以来不推荐使用的某些库,例如org.apache.cordova.CordovaWebViewClient。因此,我尝试在SDK 20而不是23上创建cordova。

Is there any way to do that from the cordova cli or in another way? 有什么办法可以从cordova cli或其他方式做到这一点?

Thanks 谢谢

If you want your target API version to be different then change it in ANdroidManifest.xml 如果您希望目标API版本不同,请在ANdroidManifest.xml中进行更改

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="20" />

Edit these lines. 编辑这些行。 Here android:targetSdkVersion is your Android version that you are targeting. android:targetSdkVersion是您要定位的Android版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM