ionic-team / ionic-team/ionic-cli

`ionic capacitor run android` does not allow selection of device, then crashes

Đang mở
#4,739 9 bình luận 7 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
TypeScript
Star
2k
Fork
682
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description:**
After updating to Capacitor 3 `ionic capacitor run android` now attempts to directly launch the App on a device instead of simply opening Android Studio. The device selection fails.
First `? Which device would you like to target? (Use arrow keys)` is shown. If any arrow key is pressed, the `(Use arrow keys)` text disappears. Pressing enter produces the output
> `TypeError: Cannot read property 'value' of undefined`

and nothing further happens.

**Steps to Reproduce:**

- Run `ionic capacitor run android` in a Capacitor 3 project.

**Output:**
```
xxx@xxx:~/XXXXXXXX$ ionic capacitor run android --verbose
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'capacitor', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +2ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { context: 'app', type: 'angular', errors: [], configPath: '/home/xxx/xxx/ionic.config.json' } +0ms
ionic Context: { binPath: '/home/xxx/.nvm/versions/node/v14.17.0/lib/node_modules/@ionic/cli/bin/ionic', libPath: '/home/xxx/.nvm/versions/node/v14.17.0/lib/node_modules/@ionic/cli', execPath: '/home/xxx/xxx/xxx/xxx', version: '6.16.3' } +0ms
ionic:lib:integrations:capacitor Getting config with Capacitor CLI: [ 'config', '--json' ] +0ms
ionic:lib:integrations:capacitor Could not get config from Capacitor CLI (probably old version) +267ms
ionic:commands:capacitor:run Getting native targets for 'android' with Capacitor CLI: [ 'run', 'android', '--list', '--json' ] +0ms
? Which device would you like to target?
TypeError: Cannot read property 'value' of undefined
```

**My `ionic info`:**

```

Ionic:

Ionic CLI : 6.16.3 (/home/xxx/.nvm/versions/node/v14.17.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.6
@angular-devkit/build-angular : 0.1102.11
@angular-devkit/schematics : 11.2.11
@angular/cli : 11.2.11
@ionic/angular-toolkit : 3.1.1

Capacitor:

Capacitor CLI : 3.1.1
@capacitor/android : 3.1.1
@capacitor/core : 3.1.1
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 1.4.0

System:

NodeJS : v14.17.0 (/home/xxx/.nvm/versions/node/v14.17.0/bin/node)
npm : 6.14.13
OS : Linux 5.4

```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.