phonegap 3.0 wants android 17, but I want android 18

后端 未结 11 928
南笙
南笙 2020-12-24 15:29

While experienced with phonegap and xcode, I\'m new to android. I have installed phonegap 3.0 ...

npm install phonegap
phonegap --version
3.0.0-0.14.3


        
相关标签:
11条回答
  • 2020-12-24 15:54

    PhoneGap Build now supports an option to set the Android SDK version. It is documented here but basically what you need in config.xml is:

      <preference name="android-targetSdkVersion" value="18" />
    

    It will then set the property correctly in AndroidManifest.xml.

    Note: This supposedly only works for PhoneGap build, but I am using the Ionic command line tools (on Cordova 5.1.1) and it appears to work fine for me too.

    0 讨论(0)
  • 2020-12-24 16:02

    I had installed cordova through npm, therefore to make it work I modified target in ~/.cordova/lib/npm_cache/cordova-android/3.6.3/package/framework/project.properties

    0 讨论(0)
  • 2020-12-24 16:03

    You are in the wrong place guys

    YOU SHOULD TRY THIS: phonegap local build android

    this will add the android to your platforms folder...

    0 讨论(0)
  • 2020-12-24 16:04

    If anyone gets here using cordova and/or chrome mobile app toolchain. I edited platforms/android/project.properties directly to target=android-19 and it built.

    cheers

    0 讨论(0)
  • 2020-12-24 16:04

    Make sure you have the latest version:

    • PhoneGap: sudo npm update -g phonegap
    • Android SDK: depending on how you installed it, if you did it through brew: brew update android-sdk

    Then run aandroid, and download the latest API.

    Then PhoneGap will use the latest API by default when running phonegap build android.

    If you need to update a current project, run inside the project folder:

    phonegap platform update android
    

    And now if you run build again, it should use the latest version.

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