phonegap 3.0 wants android 17, but I want android 18

后端 未结 11 986
南笙
南笙 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:53

    Find file android_parser.js in Windows it is undr path:

    C:\Users\USER_NAME\AppData\Roaming\npm\node_modules\cordova\src\metadata
    

    change in file android_parse.js

    OR if You are makking application from PhoneGap not Cordova:

    C:\Users\USER_NAME\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\metadata\android_parser.js
    

    go to line: 57

    if (output.indexOf('android-17') == -1) {
    

    and change it for:

    if (output.indexOf('android') == -1) {
    

    This will let You not to wory about future :)

    But then You can occur this Error

    [Error: An error occured during creation of android sub-project.
    ]
    

    To fix it You will have to goto this path:

    C:\Users\USER_NAME\.cordova\lib\android\cordova\3.1.0\framework\project.properties
    

    And change this line:

    target=android-17
    

    To this:

    target=android-19
    

    Or whatever is Your Android SDK version

    What to do if You want to use Android 2.2 ?

    Just simple go to:

    Your_Project_Folder/platforms/android/AndroidManifest.xml
    

    And change:

    
    

    To:

    
    

    And after that import Your project to Your IDE

    Enjoy :)

提交回复
热议问题