ionic3项目打包报错的问题,添加插件之后打包失败
新安装的一个ionic3的空白项目,我打包apk一切正常。
但是,为了测试一下如何调用native api,我在文档中找了一个关于二维码扫码的功能模块 QR Scanner来测试。
照文档的步骤安装 :
$ ionic cordova plugin add cordova-plugin-qrscanner
$ npm install --save @ionic-native/qr-scanner
于是报了下了的错
[ERROR] An error occurred while running cordova build android (exit code 1):
(truncated) ... Lib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution,
etc.).
ע: ijЩ�����ļ�ʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportAppcompatV72310Library
:prepareComAndroidSupportSupportV42310Library
:prepareComJourneyappsZxingAndroidEmbedded330Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:21: ����:
�Ҳ�������
import org.apache.cordova.PermissionHelper;
^
����: �� PermissionHelper
�: ����� org.apache.cordova
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:398: �� ��:
�Ҳ�������
if(!PermissionHelper.hasPermission(this, p))
^
����: ���� PermissionHelper
�: �� QRScanner
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:407: �� ��:
�Ҳ�������
PermissionHelper.requestPermissions(this, requestCode, permissions);
^
����: ���� PermissionHelper
�: �� QRScanner
ע: ijЩ�����ļ�ʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
ע:
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.javaʹ���� δ�����?�ȫ�IJ�����
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣
3 ������
:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':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: 11.76 secs
Error: cmd: Command failed with exit code 1 Error output:
ע: ijЩ�����ļ�ʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
ע: ijЩ�����ļ�ʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:21: ����:
�Ҳ�������
import org.apache.cordova.PermissionHelper;
^
����: �� PermissionHelper
�: ����� org.apache.cordova
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:398: �� ��:
�Ҳ�������
if(!PermissionHelper.hasPermission(this, p))
^
����: ���� PermissionHelper
�: �� QRScanner
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.java:407: �� ��:
�Ҳ�������
PermissionHelper.requestPermissions(this, requestCode, permissions);
^
����: ���� PermissionHelper
�: �� QRScanner
ע: ijЩ�����ļ�ʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
ע:
D:\my_work\ioinc\ionic-cordova-demo\platforms\android\src\com\bitpay\cordova\qrscanner\QRScanner.javaʹ���� δ�����?�ȫ�IJ�����
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣
3 ������
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':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.
_
请问这是什么原因。
然后我就把该插件重新remove掉 :ionic cordova plugin remove cordova-plugin-qrscanner
再打包又能成功了。
一定是插件安装导致的问题请问何解???### 问题描述
ionic info :
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 6.5.0
local packages:
@ionic/app-scripts : 3.0.0
Cordova Platforms : none
Ionic Framework : ionic-angular 3.7.1
System:
Android SDK Tools : 24.4.1
Node : v8.12.0
npm : 6.4.1
OS : Windows 10
Misc:
backend : pro
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
你期待的结果是什么?实际看到的错误信息又是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论