UnhandledPromiseRejectionWarning:未处理的承诺拒绝(拒绝ID:1):错误:产生EACCES Ionic 3

时间:2022-12-25 22:59:12

I 've been working on this issue for a lot of time and I can't really fix it. When I do ionic Cordova build android it works well until it gets to Cordova build android, anyone has some idea about what happened here??

我已经在这个问题上工作了很长时间,我无法解决它。当我做离子Cordova构建android它工作得很好,直到它到达Cordova构建android,任何人都对这里发生的事情有所了解?

I know that if a problem with permission but I can't found what is the directory I'd change

我知道如果有权限的问题,但我找不到我要更改的目录

KENRYMAC:RecipeBookApp Kenry$ ionic cordova build android
Running app-scripts build: --platform android --target cordova
[23:36:09]  build dev started ... 
[23:36:10]  clean started ... 
[23:36:10]  clean finished in 5 ms 
[23:36:10]  copy started ... 
[23:36:10]  deeplinks started ... 
[23:36:11]  deeplinks finished in 161 ms 
[23:36:11]  transpile started ... 
[23:36:51]  transpile finished in 40.73 s 
[23:36:51]  preprocess started ... 
[23:36:51]  preprocess finished in 1 ms 
[23:36:51]  webpack started ... 
[23:36:52]  copy finished in 42.36 s 
[23:37:20]  webpack finished in 28.48 s 
[23:37:20]  sass started ... 
Witout `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning
[23:37:23]  sass finished in 2.94 s 
[23:37:23]  postprocess started ... 
[23:37:23]  postprocess finished in 17 ms 
[23:37:23]  lint started ... 
[23:37:23]  build dev finished in 73.84 s 
> cordova build android
ANDROID_HOME=/Users/Kenry/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
(node:4570) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES
(node:4570) [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.

[23:37:31]  tslint: src/pages/signin/signin.ts, line: 4 
            'FormControl' is declared but never used. 

       L4:  import { FormControl, NgForm } from '@angular/forms';

[23:37:31]  tslint: src/pages/signup/signup.ts, line: 4 
            'FormControl' is declared but never used. 

       L4:  import { FormControl, NgForm } from '@angular/forms';

[23:37:31]  lint finished in 8.22 s 

Please, can anyone give me some clues?? Thank you

拜托,谁能给我一些线索?谢谢

1 个解决方案

#1


13  

Run the following command:

运行以下命令:

cordova build android --verbose

You can get output something like this:

你可以获得这样的输出:

Running command: /usr/libexec/java_home
Command finished with error code 0: /usr/libexec/java_home
ANDROID_HOME=/Users/mj/phonegap/adt-bundle-mac-x86_64-20140321/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"
 -p /Users/mj/EduceMobile/app/platforms/android wrapper -b /Users/mj/EduceMobile/app/platfo
rms/android/wrapper.gradle

Error: spawn EACCES
    at exports._errnoException (util.js:1018:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at Object.exports.spawn (child_process.js:378:9)
    .....
    .....

Note the line:

注意这一行:

Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"

运行命令:“/ Applications / Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle”

This shows that there is permission issue with the file /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle.

这表明文件/ Applications / Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle存在权限问题。

To fix the issue, give appropriate permission to that file so that it can be executable.

要解决此问题,请为该文件提供适当的权限,以使其可执行。

You can run the following command:

您可以运行以下命令:

sudo chmod +x /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle

This should solve the issue.

这应该可以解决问题。

#1


13  

Run the following command:

运行以下命令:

cordova build android --verbose

You can get output something like this:

你可以获得这样的输出:

Running command: /usr/libexec/java_home
Command finished with error code 0: /usr/libexec/java_home
ANDROID_HOME=/Users/mj/phonegap/adt-bundle-mac-x86_64-20140321/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"
 -p /Users/mj/EduceMobile/app/platforms/android wrapper -b /Users/mj/EduceMobile/app/platfo
rms/android/wrapper.gradle

Error: spawn EACCES
    at exports._errnoException (util.js:1018:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at Object.exports.spawn (child_process.js:378:9)
    .....
    .....

Note the line:

注意这一行:

Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"

运行命令:“/ Applications / Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle”

This shows that there is permission issue with the file /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle.

这表明文件/ Applications / Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle存在权限问题。

To fix the issue, give appropriate permission to that file so that it can be executable.

要解决此问题,请为该文件提供适当的权限,以使其可执行。

You can run the following command:

您可以运行以下命令:

sudo chmod +x /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle

This should solve the issue.

这应该可以解决问题。