江玲华*_*江玲华 30 android react-native
安装APK调试到我的设备失败.
jianglinghuadeMacBook-Pro:hello jianglinghua$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug...
WARNING [Project: :app] Current NDK support is deprecated. Alternative will be provided in the future.
:app:preBuild UP-TO-DATE
......
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'MI NOTE LTE - 6.0.1'
Unable to install /Users/jianglinghua/Desktop/hello/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
at com.android.ddmlib.Device.installPackages(Device.java:894)
........
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
:app:installDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 13.945 secs
Run Code Online (Sandbox Code Playgroud)
无法在设备上安装应用程序,请阅读上面的错误以获取详细信息.确保运行Android模拟器或连接设备并设置Android开发环境:https: //facebook.github.io/react-native/docs/android-setup.html
我看看我的设备
jianglinghuadeMacBook-Pro:hello jianglinghua$ adb devices
List of devices attached
98333978 device
Run Code Online (Sandbox Code Playgroud)
小智 33
就我而言,我已经设置了一个新的应用程序,但遇到了错误,尝试了许多可能的方法以及来自 github 和 stackoverflow 的答案。没有任何作用
错误
我的解决方案是..检查您是否已经在android中安装了同名的应用程序..
Delete old apps and run react-native run-android
为我工作。
Mah*_*ndi 26
在我的 android 设备上,问题出在我之前在手机上安装的应用程序的先前构建版本。以下步骤解决了我的问题:
删除应用程序的任何先前版本,包括调试版本和签名的 apk 版本
在 Windows 上:在项目的根目录中,运行:
cd android
.\gradlew clean
cd ..
npm cache clean --force
在 MacOS 上:在项目的根目录中,运行:
cd android
.\gradlew clean
cd ..
重启你的安卓设备
Hai*_*inh 18
第 1 步:关闭 Android 模拟器。
第二步:打开Android虚拟设备管理器,按照下图擦除数据:
第 3 步:打开终端并输入
cd android
.\gradlew clean
cd ..
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
第 4 步:在终端中,运行:
yarn run android
Run Code Online (Sandbox Code Playgroud)
注意:如果您使用的是纱线,只需运行:
yarn cache clean
Run Code Online (Sandbox Code Playgroud)
我解决了这个问题,为设备添加了更多内存,我是这样做的:
我遇到了同样的问题并做了一些研究.这个问题在中国的Android手机上发生了很多.
它通过将文件android/build.gradle第8行中的gradle版本更改为1.2.3来解决
classpath 'com.android.tools.build:gradle:1.2.3'
Run Code Online (Sandbox Code Playgroud)
在我的情况下(使用 React Native),我运行服务器的 PC 无法识别我的 Android 手机,可以通过以下消息看到:
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No online devices found.
Run Code Online (Sandbox Code Playgroud)
如果是这种情况,如ADB Android Device Unauthorized 中突出显示的,请确保在手机上的开发人员选项中将USB 调试设置为 true,并在终端或 cmd 中输入以下命令以重新启动 Android 服务器。
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No online devices found.
Run Code Online (Sandbox Code Playgroud)
并且adb devices
应该将您的手机列为device
而不是unauthorized
小智 5
转到android / build.gradle,更改
classpath 'com.android.tools.build:gradle:2.2.3'
至
classpath 'com.android.tools.build:gradle:1.2.3'
然后,转到 android / gradle / wrapper / gradle-wrapper.properties,将distributionURL更改为https://services.gradle.org/distributions/gradle-2.2-all.zip
再次运行。
我也遇到了使用 gradle 2.14 的应用程序的问题,但使用 gradle 4 没关系。通过使用 --deviceID 标志应用程序安装没有任何问题。
react-native run-android --deviceId=mydeviceid
Run Code Online (Sandbox Code Playgroud)
小智 2
我也遇到了同样的问题,AVD 设置错误。也许“目标 Android 6.0”是错误的选择。
接下来的设置已更改以修复“:app:installDebug FAILED”问题:系统映像:Marshmallow、API 23、ABI x86、目标 Google API。
请参阅此处的详细信息: RN Android 设置
归档时间: |
|
查看次数: |
45728 次 |
最近记录: |