解决React Native安装应用到真机(红米3S)报Execution failed for task ':app:installDebug'的错误

报错信息如下:

:app:installDebug

Installing APK 'app-debug.apk' on 'Redmi 3S - 6.0.1'
Unable to install D:\ReactNative-Workspace\FirstRNProject\android\app\build\outp
uts\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
        at com.android.ddmlib.Device.installPackages(Device.java:894)
        at com.android.builder.testing.ConnectedDevice.installPackages(Connected
Device.java:113)

........ 中间一大堆报错信息省略 .........

: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.InstallExc
eption: Failed to establish session


解决过程:手机型号(红米3S,系统MIUI 8);先检查了一下开发者选项,USB调试、未知源 都是开启的;

然后发现 “启用MIUI优化”这一项是开启的,把它关掉(设置----更多设置----开发者选项----启用MIUI优化 关闭)

发布了2 篇原创文章 · 获赞 0 · 访问量 2059
展开阅读全文

reactnative启动报错 app:compileDebugJavaWithJavac

10-25

scanning folders for symlinks in E:\SimpleApp\SimpleApp\node_modules (30ms) Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)... Starting a new Gradle Daemon for this build (subsequent builds will be faster). Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE :app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE :app:prepareComFacebookFrescoFresco130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE :app:prepareComFacebookReactReactNative0493Library UP-TO-DATE :app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:bundleDebugJsAndAssets SKIPPED :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). :app:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Unexpected lock protocol found in lock file. Expected 3, found 0. 问答

android failed for task ':app:dexDebug'

04-23

我使用SVN更新了项目后出现这个错误,貌似是更新了包,我用的是V7包,别人用的是V4,怎么改可以正常运行呀?最好项目以后更新也不会出现这个问题 Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\Administrator\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output D:\android-studio\exercise\ex05\svn_androidStuido\app\build\intermediates\dex\debug --input-list=D:\android-studio\exercise\ex05\svn_androidStuido\app\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106) 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览