gpt4 book ai didi

android - 无法使用 ionic 项目创建 apk

转载 作者:行者123 更新时间:2023-11-29 16:55:35 26 4
gpt4 key购买 nike

嗨,我是 ionic 的新手,我正在尝试创建一个 apk 以测试我的 qr 扫描仪项目,但是当我运行命令 ionic cordova build android --release我得到以下错误输出:

参见 http://g.co/androidstudio/manifest-merger有关 list 合并的更多信息。

    :processReleaseManifest FAILED

BUILD FAILED

Total time: 13.446 secs
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs

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

有人可以帮我吗?

输出:

C:\Users\delacrga\Ionic projects\myApp>ionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myalias
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser

[08:52:04] build prod started ...
[08:52:04] clean started ...
[08:52:04] clean finished in 10 ms
[08:52:04] copy started ...
[08:52:04] ngc started ...
[08:52:15] ngc finished in 11.48 s
[08:52:15] preprocess started ...
[08:52:16] deeplinks started ...
[08:52:16] deeplinks finished in 63 ms
[08:52:16] optimization started ...
[08:52:16] copy finished in 11.85 s
[08:52:26] optimization finished in 10.47 s
[08:52:26] preprocess finished in 10.54 s
[08:52:26] webpack started ...
[08:52:32] webpack finished in 5.46 s
[08:52:32] sass started ...
[08:52:32] uglifyjs started ...
[08:52:33] sass finished in 1.22 s
[08:52:33] cleancss started ...
[08:52:35] cleancss finished in 1.93 s
[08:52:42] uglifyjs finished in 10.23 s
[08:52:42] postprocess started ...
[08:52:42] postprocess finished in 15 ms
[08:52:42] lint started ...
[08:52:42] build prod finished in 37.83 s
> cordova build android --release -- --keystore=filename.keystore --alias=myalias
× Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android --release -- --keystore=filename.keystore --alias=myalias
(exit code 1):

ANDROID_HOME=C:\Users\delacrga\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use
Task.doLast(Action) instead.
at build_amlj4yw9chmdse17z8bfqqws2.run(C:\Users\delacrga\Ionic
projects\myApp\platforms\android\build.gradle:139)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289

* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore

* 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: 4.175 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289

* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore

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

最佳答案

如果您安装了两个不同的插件,要求获得相机许可,即 cordova-plugin-qrscanner 和 phonegap-plugin-barcodescanner 一起安装,则会导致此问题。

删除任一插件

ionic cordova plugin remove phonegap-plugin-barcodescanner

ionic cordova plugin remove cordova-plugin-qrscanner

关于android - 无法使用 ionic 项目创建 apk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45111114/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com