Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 构建Android应用程序删除adb可执行文件_Android Studio_Android Gradle Plugin_React Native Android_Android Build - Fatal编程技术网

Android studio 构建Android应用程序删除adb可执行文件

Android studio 构建Android应用程序删除adb可执行文件,android-studio,android-gradle-plugin,react-native-android,android-build,Android Studio,Android Gradle Plugin,React Native Android,Android Build,我使用react native init…创建了一个新应用程序。按照文档安装了android开发工具,并尝试使用react native run android运行 我发现了错误 失败:生成失败,出现异常 出了什么问题: 发现任务“:app:installDebug”的配置有问题。 为属性“adbExe”指定的文件“C:\Android\sdk\platform tools\adb.exe”不存在 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项

我使用
react native init…
创建了一个新应用程序。按照文档安装了android开发工具,并尝试使用
react native run android
运行

我发现了错误

失败:生成失败,出现异常

  • 出了什么问题: 发现任务“:app:installDebug”的配置有问题。 为属性“adbExe”指定的文件“C:\Android\sdk\platform tools\adb.exe”不存在

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出

构建失败

总时间:1分钟7.058秒

我已经尝试过几次(删除然后重新安装SDK等),我注意到当我安装SDK和工具时,
adb
正在上面的位置安装,但是当构建启动/模拟器启动或android studio加载项目时,它会消失(删除?)

无论我是运行
react native run android
还是在android Studio(3.0.1)中打开
[AppFolder]\android
并运行[run>run'app']

我将平台工具文件夹复制到其他地方,并在android studio打开后将其替换,当android studio或emulator运行几秒钟后,adb仍然会消失。如果我运行
react native run android
,则相同

同一个项目在OSX上运行良好。(克隆项目后,我不得不手动
chmod+xgradlew
,但我认为这与此无关。)

配置

  • 操作系统Windows 10 v1709(版本16299.125)-没有挂起的更新
  • 反应本机0.51
  • android studio 3.0.1
  • gradle版本我认为是2.2.3,如下所示
build.gradle文件(我没有更改此文件-由react native cli生成)

SDK安装后立即安装

在使用project open运行android studio后/emulator启动/react本机运行android


能否尝试将adb.exe放置在其他位置,并确保它位于路径中?
可能是某些杀毒软件删除了它吗?

没有乐趣。。同样的错误。(它没有在其他位置删除我的adb)gradle任务:app:installDebug在特定位置C:\Android\sdk\platform tools\adb.exe查找adb。它是AVAST!。。这是他妈的阿瓦斯特。。谢谢我在隔离区有25份adb。不客气:)我知道BitDefender也在做类似的事情,它会删除我的autoconf生成的测试exe文件。哇,我不敢相信我错过了这一份。在Avast中添加了一个排除项,效果很好。Avast静默模式一定已经吞没了通知。圣诞快乐,朋友!没问题,也祝你圣诞快乐:)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
 }
}

allprojects {
    repositories {
    mavenLocal()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
    }
}