gpt4 book ai didi

android - 应用程序 :installDebug Task while attempting to run react-native app on MI MAX 2 android device 期间的 SecurityException

转载 作者:行者123 更新时间:2023-12-03 13:27:10 25 4
gpt4 key购买 nike

运行npx react-native run-android正在使用 android 模拟器,以及我拥有的三星设备。但是在连接 MI MAX 2 设备时,我得到以下信息:

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'MI MAX 2 - 7.1.1' for app:debug

> Task :app:installDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
847 actionable tasks: 2 executed, 845 up-to-date
Unable to install /Users/[....]/android/app/build/outputs/apk/debug/app-debug.apk
com.android.ddmlib.InstallException: Unknown failure: Error: java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag
at com.android.ddmlib.internal.DeviceImpl.installRemotePackage(DeviceImpl.java:1224)
at com.android.ddmlib.internal.DeviceImpl.installPackage(DeviceImpl.java:1050)
at com.android.ddmlib.internal.DeviceImpl.installPackage(DeviceImpl.java:1026)
at com.android.ddmlib.internal.DeviceImpl.installPackage(DeviceImpl.java:1015)
at ... etc, etc, etc

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure: Error: java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag

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

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

BUILD FAILED in 30s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=4105
Unable to install /Users/[....]/android/app/build/outputs/apk/debug/app-debug.apk
注意:我尝试将以下内容添加到我的 AndroidManifest.xml但这似乎没有什么不同:
<uses-permission android:name="android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS"/>
有任何想法吗?

最佳答案

确保所有三个

  • 开发者选项->USB调试
  • 开发者选项 -> USB 调试(安全设置)
  • 开发者选项 -> 通过 USB 安装

  • 开启

    关于android - 应用程序 :installDebug Task while attempting to run react-native app on MI MAX 2 android device 期间的 SecurityException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64787260/

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