gpt4 book ai didi

android - 构建时的 ionic 错误

转载 作者:行者123 更新时间:2023-11-30 00:03:26 24 4
gpt4 key购买 nike

我正在尝试为我使用 ionic 制作的 Android 构建和应用程序,我安装了 Android SDK Manager 并进行了所有更新,然后我安装了 Android Studio,然后我关注了this guide构建应用程序(我之前做了 ionic cordova platform add android)我在 Windows 7 64 位上运行,带有 Ionic 3.20.0 和 Cordova 8.0.0这是 git Bash 显示的内容:

$ ionic cordova build --release android
Running app-scripts build: --platform android --target cordova
[12:42:03] build dev started ...
[12:42:03] clean started ...
[12:42:03] clean finished in 15 ms
[12:42:03] copy started ...
[12:42:03] deeplinks started ...
[12:42:03] deeplinks finished in 46 ms
[12:42:03] transpile started ...
[12:42:10] transpile finished in 6.79 s
[12:42:10] preprocess started ...
[12:42:10] preprocess finished in less than 1 ms
[12:42:10] webpack started ...
[12:42:10] copy finished in 7.05 s
[12:42:20] webpack finished in 9.41 s
[12:42:20] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[12:42:21] sass finished in 1.42 s
[12:42:21] postprocess started ...
[12:42:21] postprocess finished in 171 ms
[12:42:21] lint started ...
[12:42:21] build dev finished in 17.99 s
> cordova build android --release
Android Studio project detected

ANDROID_HOME=C:\Users\DELL\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_112
studio
Subproject Path: CordovaLib
Subproject Path: app
[12:42:26] lint finished in 5.26 s
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Checking the license for package Android SDK Platform 26 in C:\Users\DELL\AppData\Local\Android\android-sdk\licenses
Warning: License for package Android SDK Platform 26 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 26].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

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

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
(node:6316) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 26].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

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

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
at ChildProcess.whenDone (C:\Users\DELL\Desktop\ecrypt\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:6316) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6316) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

最佳答案

转到

~/Library/Android/sdk/tools/bin

然后按如下方式运行 sdkmanager:

./sdkmanager --licenses

并接受您未接受的许可。

关于android - 构建时的 ionic 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49464351/

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