Произошла ошибка при запуске подпроцесса cordova. sh не распознается - PullRequest
0 голосов
/ 14 февраля 2020

Я создаю файл apk для моего приложения ioni c angular и пытаюсь запустить команду "ioni c cordova build" и получаю следующую ошибку

   ? What platform would you like to build (android, ios): android
     > ionic-app-scripts.cmd build --target cordova --platform android
   [13:27:20]  ionic-app-scripts 3.2.4
   [13:27:20]  build dev started ...
   [13:27:20]  clean started ...
   [13:27:20]  clean finished in 11 ms
   [13:27:20]  copy started ...
   [13:27:20]  deeplinks started ...
   [13:27:21]  deeplinks finished in 228 ms
   [13:27:21]  transpile started ...
   [13:27:29]  transpile finished in 8.25 s
   [13:27:29]  preprocess started ...
   [13:27:29]  preprocess finished in 1 ms
   [13:27:29]  webpack started ...
   [13:27:29]  copy finished in 8.83 s
   [13:27:35]  webpack finished in 6.03 s
   [13:27:35]  sass started ...
   [13:27:37]  sass finished in 1.73 s
   [13:27:37]  postprocess started ...
   [13:27:37]  postprocess finished in 10 ms
   [13:27:37]  lint started ...
   [13:27:37]  build dev finished in 16.54 s
   [13:27:42]  lint finished in 5.51 s
  > cordova.cmd build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk (recommended setting)
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk (DEPRECATED)
'sh' is not recognized as an internal or external command,
operable program or batch file.
C:\Gradle\gradle-6.1.1\bin\gradle: Command failed with exit code 1
[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information. 

У меня есть попытался выполнить следующие шаги, но все еще получаю ту же ошибку.

'cordova platform remove android'
'cordova platform add android'

вот мой пакет. json

{
"name": "app_name",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
 },
 "dependencies": {
 "@angular/animations": "5.2.11",
 "@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/camera": "^4.20.0",
"@ionic-native/core": "4.20.0",
"@ionic-native/device": "^4.20.0",
"@ionic-native/fcm": "^4.20.0",
"@ionic-native/file": "^4.20.0",
"@ionic-native/splash-screen": "4.20.0",
"@ionic-native/status-bar": "4.20.0",
"@ionic/storage": "2.2.0",
"build": "0.1.4",
"cordova-android": "8.1.0",
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-device": "2.0.2",
"cordova-plugin-fcm-with-dependecy-updated": "4.1.1",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"ionic-angular": "3.9.9",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"rxjs-compat": "^6.5.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.29"
  },
  "devDependencies": {
"@ionic/app-scripts": "^3.2.4",
"typescript": "2.6.2"
},
 "description": "An Ionic project",
 "cordova": {
  "plugins": {
   "cordova-plugin-device": {},
   "cordova-plugin-whitelist": {},
   "cordova-plugin-statusbar": {},
   "cordova-plugin-splashscreen": {},
    "cordova-plugin-ionic-webview": {
    "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
    },
    "cordova-plugin-ionic-keyboard": {},
    "cordova-plugin-camera": {
     "ANDROID_SUPPORT_V4_VERSION": "27.+"
    },
  "cordova-plugin-file": {},
  "cordova-plugin-fcm-with-dependecy-updated": {}
  },
 "platforms": [
  "android"
 ]
}
 }''

есть ли несовпадение версий в моем пакете. json файл или я что-то пропустил. Может ли кто-нибудь помочь мне за то же самое?

...