A
A
Art Root2016-08-19 06:31:22
Java
Art Root, 2016-08-19 06:31:22

After changing android api version from 23 to 19, cordova gives deprecated API error. How to decide?

Everything works with the android-23 version, but I need to make support for android 4+ and try to build it in another API
ionic platform add android
, it immediately makes version 23.
I can’t find it - How can I add the old version right away?
And then I reduce to the old one

android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"

From the command, he replaced it like everywhere except the AndroidManifest.xml file
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />

here, too, I changed it with my hands to 19.
After I do build and gives errors:
Error: cmd: Command failed with exit code 1 Error output:
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaClientCertRequest.java:25: error: cannot find symbol
import android.webkit.ClientCertRequest;
                     ^
  symbol:   class ClientCertRequest
  location: package android.webkit
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaClientCertRequest.java:32: error: cannot find symbol
    private final ClientCertRequest request;
                  ^
  symbol:   class ClientCertRequest
  location: class CordovaClientCertRequest
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaClientCertRequest.java:34: error: cannot find symbol
    public CordovaClientCertRequest(ClientCertRequest request) {
                                    ^
  symbol:   class ClientCertRequest
  location: class CordovaClientCertRequest
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:41: error: cannot find symbol
import android.webkit.PermissionRequest;
                     ^
  symbol:   class PermissionRequest
  location: package android.webkit
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:265: error: cannot find symbol
    public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]
 filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams)


                                         ^
  symbol:   class FileChooserParams
  location: class WebChromeClient
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:285: error: cannot find symbol
    public void onPermissionRequest(final PermissionRequest request) {
                                          ^
  symbol:   class PermissionRequest
  location: class SystemWebChromeClient
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebViewClient.java:29: error: cannot find symbol
import android.webkit.ClientCertRequest;
                     ^
  symbol:   class ClientCertRequest
  location: package android.webkit
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebViewClient.java:116: error: cannot find symbol
    public void onReceivedClientCertRequest (WebView view, ClientCertRequest re
uest)
                                                           ^
  symbol:   class ClientCertRequest
  location: class SystemWebViewClient
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemCookieManager.java:35: error: cannot find symbol
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
                                  ^
  symbol:   variable LOLLIPOP
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:263: error: cannot find symbol
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
                                  ^
  symbol:   variable LOLLIPOP
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:283: error: cannot find symbol
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
                                  ^
  symbol:   variable LOLLIPOP
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaInterfaceImpl.java:227: error: cannot find symbol
        getActivity().requestPermissions(permissions, mappedRequestCode);
                     ^
  symbol:   method requestPermissions(String[],int)
  location: class Activity
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaInterfaceImpl.java:232: error: cannot find symbol
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
                                                       ^
  symbol:   variable M
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaInterfaceImpl.java:234: error: cannot find symbol
            int result = activity.checkSelfPermission(permission);
                                 ^
  symbol:   method checkSelfPermission(String)
  location: variable activity of type Activity
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\CordovaActivity.java:493: error: method does not override or imple
ent a method from a supertype
    @Override
    ^
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemCookieManager.java:43: error: cannot find symbol
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                                        ^
  symbol:   variable LOLLIPOP
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemCookieManager.java:44: error: cannot find symbol
            cookieManager.setAcceptThirdPartyCookies(webView, true);
                         ^
  symbol:   method setAcceptThirdPartyCookies(WebView,boolean)
  location: variable cookieManager of type CookieManager
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemCookieManager.java:65: error: cannot find symbol
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                                        ^
  symbol:   variable LOLLIPOP
  location: class VERSION_CODES
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemCookieManager.java:66: error: cannot find symbol
            cookieManager.flush();
                         ^
  symbol:   method flush()
  location: variable cookieManager of type CookieManager
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:264: error: method does not over
ide or implement a method from a supertype
    @Override
    ^
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:271: error: cannot find symbol
                    Uri[] result = WebChromeClient.FileChooserParams.parseResul
(resultCode, intent);
                                                  ^
  symbol:   variable FileChooserParams
  location: class WebChromeClient
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebChromeClient.java:284: error: method does not over
ide or implement a method from a supertype
    @Override
    ^
E:\Documents\NetBeansProjects\butt.mod20\platforms\android\CordovaLib\src\org\a
ache\cordova\engine\SystemWebViewClient.java:114: error: method does not overri
e or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
23 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

How can you defeat this?
SOLUTION
As always, read the documentation:
cordova.apache.org/docs/en/latest/platform_plugin_...
cordova platform add [email protected] --save

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Art Root, 2016-08-24
@chapaevartem

As always, read the documentation:
cordova.apache.org/docs/en/latest/platform_plugin_...
cordova platform add [email protected] --save

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question