无法运行cordova运行android设备

33qvvth1  于 2022-12-04  发布在  Android
关注(0)|答案(1)|浏览(290)

根据playstore的要求,我将我的应用程序API级别(targetSdkVersion)更改为31。
我已从Android Studio卸载了API级别30,并安装了API级别31。
之后,我无法在设备上运行我的应用程序进行调试。
我收到一条消息,提示“找不到与{ type:'设备' }”

C:\htdocs\app\myapp>cordova run android --device
Checking Java JDK and Android SDK versions
ANDROID_HOME=C:\Users\myusr\AppData\Local\Android\Sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Using Android SDK: undefined
Reading build config file: C:\htdocs\app\verpro\build.json
Subproject Path: CordovaLib
Subproject Path: app

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 960ms
50 actionable tasks: 50 up-to-date
Built the following apk(s):
        C:\htdocs\app\verpro\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Checking Java JDK and Android SDK versions
ANDROID_HOME=C:\Users\ncchi\AppData\Local\Android\Sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Using Android SDK: undefined
Reading build config file: C:\htdocs\app\verpro\build.json
Could not find target matching { type: 'device' }
yiytaume

yiytaume1#

转到设备管理器并单击android studio中的物理设备(在设备的开发者模式下使用USB /无线路由设备后)。单击物理设备后,您应该能够看到设备中填充的文件夹。如果没有,然后点击pair using code / pair using QR code选项。因此,基本上您只需要将设备与android studio配对,然后您就可以使用命令cordova run android --verbose

相关问题