D:\myApp>ionic run android
Running command: D:\environment\nodejs\node.exe D:\myApp\hooks\after_prepare\010_add_platform_class.js D:\myApp
add to body class: platform-android
ANDROID_HOME=D:\environment\Android\sdk
JAVA_HOME=D:\environment\Java\jdk
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Incremental java compilation is an incubating feature.
:preBuild
UP-TO-DATE
:preDebugBuild
UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild
UP-TO-DATE
:CordovaLib:preDebugBuild
UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
UP-TO-DATE
:CordovaLib:compileDebugNdk
UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders
UP-TO-DATE
:CordovaLib:generateDebugAssets
UP-TO-DATE
:CordovaLib:mergeDebugAssets
UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
UP-TO-DATE
:CordovaLib:packageDebugRenderscript
UP-TO-DATE
:CordovaLib:compileDebugRenderscript
UP-TO-DATE
:CordovaLib:generateDebugResValues
UP-TO-DATE
:CordovaLib:generateDebugResources
UP-TO-DATE
:CordovaLib:packageDebugResources
UP-TO-DATE
:CordovaLib:processDebugManifest
UP-TO-DATE
:CordovaLib:generateDebugBuildConfig
UP-TO-DATE
:CordovaLib:processDebugResources
UP-TO-DATE
:CordovaLib:generateDebugSources
UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard
UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:25: ����: �Ҳ�������
import android.webkit.ClientCertRequest;
^
����: �� ClientCertRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:32: ����: �Ҳ�������
private final ClientCertRequest request;
^
����: �� ClientCertRequest
�: �� CordovaClientCertRequest
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:34: ����: �Ҳ������
�
public CordovaClientCertRequest(ClientCertRequest request) {
^
����: �� ClientCertRequest
�: �� CordovaClientCertRequest
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:40: ����: �Ҳ�������
import android.webkit.PermissionRequest;
^
����: �� PermissionRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:264: ����: �Ҳ�������
public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]> filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
^
����: �� FileChooserParams
�: �� WebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:284: ����: �Ҳ�������
public void onPermissionRequest(final PermissionRequest request) {
^
����: �� PermissionRequest
�: �� SystemWebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:29: ����: �Ҳ������
�
import android.webkit.ClientCertRequest;
^
����: �� ClientCertRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:116: ����: �Ҳ������
�
public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
^
����: �� ClientCertRequest
�: �� SystemWebViewClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:35: ����: �Ҳ������
�
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:262: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:282: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:226: ����: �Ҳ�������
getActivity().requestPermissions(permissions, mappedRequestCode);
^
����: ���� requestPermissions(String[],int)
�: �� Activity
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:231: ����: �Ҳ�������
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
^
����: ���� M
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:233: ����: �Ҳ�������
int result = activity.checkSelfPermission(permission);
^
����: ���� checkSelfPermission(String)
λ��: ����ΪActivity�ı��� activity
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:503: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:43: ����: �Ҳ������
�
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:44: ����: �Ҳ�������
cookieManager.setAcceptThirdPartyCookies(webView, true);
^
����: ���� setAcceptThirdPartyCookies(WebView,boolean)
λ��: ����ΪCookieManager�ı��� cookieManager
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:65: ����: �Ҳ�������
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:66: ����: �Ҳ�������
cookieManager.flush();
^
����: ���� flush()
λ��: ����ΪCookieManager�ı��� cookieManager
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:263: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:270: ����: �Ҳ������
�
Uri[] result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
^
����: ���� FileChooserParams
�: �� WebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:283: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:114: ����: �������Ḳ�ǻ�ʵ� ֳ����͵ķ���
@Override
^
ע: ijЩ�����ļ�ʹ�û�����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
23 ������
:CordovaLib:compileDebugJavaWithJavac
FAILED
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.
BUILD FAILED
Total time: 1 mins 4.324 secs
Error: cmd: Command failed with exit code 1 Error output:
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:25: ����: �Ҳ�������
import android.webkit.ClientCertRequest;
^
����: �� ClientCertRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:32: ����: �Ҳ�������
private final ClientCertRequest request;
^
����: �� ClientCertRequest
�: �� CordovaClientCertRequest
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaClientCertRequest.java:34: ����: �Ҳ�������
public CordovaClientCertRequest(ClientCertRequest request) {
^
����: �� ClientCertRequest
�: �� CordovaClientCertRequest
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:40: ����: �Ҳ�������
import android.webkit.PermissionRequest;
^
����: �� PermissionRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:264: ����: �Ҳ�������
public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]> filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
^
����: �� FileChooserParams
�: �� WebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:284: ����: �Ҳ�������
public void onPermissionRequest(final PermissionRequest request) {
^
����: �� PermissionRequest
�: �� SystemWebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:29: ����: �Ҳ�������
import android.webkit.ClientCertRequest;
^
����: �� ClientCertRequest
�: ������ android.webkit
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:116: ����: �Ҳ�������
public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
^
����: �� ClientCertRequest
�: �� SystemWebViewClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:35: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:262: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:282: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:226: ����: �Ҳ�������
getActivity().requestPermissions(permissions, mappedRequestCode);
^
����: ���� requestPermissions(String[],int)
�: �� Activity
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:231: ����: �Ҳ�������
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
^
����: ���� M
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:233: ����: �Ҳ�������
int result = activity.checkSelfPermission(permission);
^
����: ���� checkSelfPermission(String)
λ��: ����ΪActivity�ı��� activity
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:503: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:43: ����: �Ҳ�������
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:44: ����: �Ҳ�������
cookieManager.setAcceptThirdPartyCookies(webView, true);
^
����: ���� setAcceptThirdPartyCookies(WebView,boolean)
λ��: ����ΪCookieManager�ı��� cookieManager
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:65: ����: �Ҳ�������
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
����: ���� LOLLIPOP
�: �� VERSION_CODES
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:66: ����: �Ҳ�������
cookieManager.flush();
^
����: ���� flush()
λ��: ����ΪCookieManager�ı��� cookieManager
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:263: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:270: ����: �Ҳ�������
Uri[] result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
^
����: ���� FileChooserParams
�: �� WebChromeClient
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebChromeClient.java:283: ����: �������Ḳ�ǻ�ʵ�ֳ����͵ķ���
@Override
^
D:\myApp\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemWebViewClient.java:114: ����: �������Ḳ�ǻ�ʵ� ֳ����͵ķ���
@Override
^
ע: ijЩ�����ļ�ʹ�û�����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
23 ������
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.
D:\myApp>
答案 0 :(得分:3)
添加这两个插件
“ cordova-plugin-androidx”:{},
“ cordova-plugin-androidx-adapter”:{}
为我解决了这个问题。
答案 1 :(得分:2)
以下为我工作。按此顺序
离子平台删除android
离子平台添加android
离子准备安卓
离子构建android
答案 2 :(得分:2)
ionic cordova platform rm android
ionic cordova platform add android
ionic cordova prepare android
ionic cordova build android
这适用于现代版本的Ionic CLI。如果它不起作用,请尝试下载最新版本。
答案 3 :(得分:2)
ionic platform remove android
ionic platform add android@6.3.0
我希望这可能有所帮助
答案 4 :(得分:1)
ionic cordova platform remove android
ionic cordova platform add android@6.3.0
ionic cordova prepare android
ionic cordova build android
答案 5 :(得分:0)
这必须是您安装的两个插件不兼容。我正在使用本地通知来解决这个问题。我通过将其版本降级为与其他插件兼容的版本来管理它。
通过命令
查看哪个插件导致问题ionic cordova plugin list
并在删除不兼容的插件时构建。
答案 6 :(得分:0)
在project.properties中添加以下行,然后重新构建。
cordova.system.library.1 = com.google.android.gms:play-services-auth:9.8.0 cordova.system.library.2 = com.google.android.gms:play-services-identity: 9.8.0
答案 7 :(得分:0)
ionic cordova platform remove android
ionic cordova platform add android@6.3.0
ionic cordova prepare android
ionic cordova build android
由于6.3.0版本定义,它才对我有用,如果您尝试不使用它,则可以尝试使用
答案 8 :(得分:0)
1).ionic cordova平台删除android
2).ionic cordova平台添加android@8.0.0
3).ionic cordova准备android
4).ionic cordova构建android