ionic add platform android with custom android-target

前端 未结 3 1991
执笔经年
执笔经年 2020-12-29 21:13

Anybody knows how to add platform in ionic with custom android target ? If I try this command :

ionic platform add android

It al

相关标签:
3条回答
  • 2020-12-29 22:02

    To change the build version you want change your config.xml located at the root project's path.

    Following lines add in config.xml and then settings are updated automatically at the time building android app.

    <platform name="android">
    
      <preference name="android-minSdkVersion" value="XX"/> 
      <preference name="android-targetSdkVersion" value="XX"/>
    
      <!--other line code -->
    
    </platform>
    

    For Ionic2 please check my gist to here.

    Hope this will help you !

    0 讨论(0)
  • 2020-12-29 22:11

    if you are unaware about the version number try following command

    cordova platform add android@latest
    

    this will add latest platform to your application, make sure you try the following command to verify if it breaks anything.

    cordova build android
    
    0 讨论(0)
  • 2020-12-29 22:16

    You should be able to see all the versions of platforms installed in your project with:

    cordova platform list
    

    Then you can remove the current version with:

    cordova platform remove android
    

    And install the version you want/need with: (in my case 6.1.1)

    cordova platform add android@6.1.1
    

    Source: cordova.apache.org documentation

    0 讨论(0)
提交回复
热议问题