Cordova Android project doesn't compile

后端 未结 3 1681
北海茫月
北海茫月 2020-12-15 10:26

Cordova version: 4.3.0

java version \"1.8.0_40\" 64bit

OS X 10.10.2

Ant version: 1.9.4

\

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

    Install Android build tools version 21 and 22 from SDK Manager.
    Once the build tools are installed, remove the platforms folder inside your app.
    Go to Cordova and add the android platform again (using cordova platform add android command).
    Once the platform is reinstalled, rebuild the app (using cordova build command) and it will build successfully

    0 讨论(0)
  • 2020-12-15 11:13

    Your Cordova is too high to work with Android Api 19. Meaning it's newer so it references libraries that Api 19 doesn't have and gives an error. So you need to dumb it down a little bit.

    Uninstall it:

    sudo npm uninstall -g cordova 
    

    And then install an older version of cordova that works well with Api 19:

    sudo npm install -g cordova@4.0.0
    

    and now do everything again from scratch. "cordova create blabla", "cordova platform add android", "cordova run android", etc.

    To get a list of cordova versions do:

    npm view cordova versions
    

    But I know that 4.0.0 will work with Api 19 since I had the same problem.

    0 讨论(0)
  • 2020-12-15 11:30

    I think it's because the Cordova 4.3.0 has referenced the android.webkit.ClientCertRequest, which is newly added in API level 21.

    FYI: https://developer.android.com/reference/android/webkit/ClientCertRequest.html

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