Android Uiautomator2 gradlew 坑

安裝錯誤: Gradle 的編譯版本太高, 不兼容部分5.0+手機, 須要下降版本爲 1.3.html

Installing APK 'app-debug.apk' on 'HUAWEI GRA-TL00 - 5.0.1' for app:debugreact

Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])android

使用AndroidStudio安裝的時候,IDE提供了app運行時須要的權限,因此直接使用Debug就能夠安裝。而使用react-native run-android有這樣的問題是由於沒有得到權限,因此無法往真機上裝應用。react-native

有兩種解決辦法,一是下降gradle的build版本,改成1.2.3;另外一種是升級你的React-Native至最新版本。api

打開 React Native 的項目, 修改最外層工程的 build.gradle 配置, 下降 gradle 的 build 爲1.2.3版本.session

buildscript {app

    repositories {maven

        jcenter()gradle

        mavenLocal()ui

    }

    dependencies {

        classpath 'com.android.tools.build:gradle:1.2.3' // 修改1.2.3

        classpath 'de.undercouch:gradle-download-task:2.0.0'

 

        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

這個時候仍是會報錯,須要從新設置 Gradle 的 Wrapper , 修改成2.2版本.

Gradle version 2.2 is required. Current version is 2.11

修改Gradle的Wrapper版本,須要修改android/griddle/wrapper/grade-wrapper.properties文件:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

 

更多錯誤

  http://blog.csdn.net/woxueliuyun/article/details/54562126

 

 

http://cache.baiducontent.com/c?m=9d78d513d9921cf04fece4690d61c0676907dc357c8a8b4368d5e35f93134c403736a4e079744744c4c40c7001d85e5d9ab6613371587ce28cc9f85dddcc85295fdb656f671df65612a40eaebb1072857bc10dfeae69b0f0a165d1e8898e834352ba44040997f0fa0b5d4bdd6e80033194b19838460346fab06b33e858073e9f5457b737afb66d305cd1e1dc2c5bc35dc76061ccf374f66d4ceb44e40b5c641aaf16f74e13313193523aaf1a605185eb2ab66b2f1c34b63fefee87abb41bce8cb76c85a98be974c43eb1d8bcae37112b0cbb38b9aabbb1366e4408&p=81759a46d6c11bb102f1c7710f4989&newp=882a9645d48b05fc57efdc21424a97231610db2151d4d0176b82c825d7331b001c3bbfb42324120ed1c1786700a94c5ee8f73679330727a3dda5c91d9fb4c57479c063&user=baidu&fm=sc&query=com%2Eandroid%2Ebuilder%2Etesting%2Eapi%2EDeviceException%3A+com%2Eandroid%2Eddmlib%2EInstallException%3A+Failed+to+establish+session&qid=f2d8006f0001c34f&p1=1 

相關文章
相關標籤/搜索