1

我刚刚在 vsCode 中使用命令托盘创建了一个新项目。然后我启动 android 模拟器,然后颤振运行。它在 ios 而不是在 android 上完美运行。

此调试控制台响应

在调试模式下在为 x86 构建的 Android SDK 上启动 lib/main.dart... 失败:构建失败并出现异常。* 出了什么问题:任务 ':app:compileDebugAidl' 执行失败。

java.lang.IllegalStateException: '/Users/sachin/Library/Android/sdk/build-tools/26.0.2/aidl' 中缺少aidl * 尝试:使用--stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。* 在https://help.gradle.org获得更多帮助 在 1 秒内构建失败 Gradle 构建失败:1 退出 (sigterm)

4

1 回答 1

0

Just now I encounter the same problem. It happened because after doing "flutter run" there's still some file that needs to be downloaded, the build tools, but didn't get downloaded correctly, because I stopped it in the middle, since I thought the process was stuck.

So, these are the steps that solve the problem:

  1. open terminal
  2. change directory to /Users/[USERNAME]/Library/Android/sdk/build-tools/, in your case, type cd /Users/sachin/Library/Android/sdk/build-tools/
  3. remove the folder that causes the error, in your case the 26.0.2 folder, so in your terminal type rm -r 26.0.2 to remove it.
  4. go back to your code, make sure the android simulator is detected, and re run the project
  5. now, wait patiently, it may takes sometime (depends on internet connection), but it's downloading the build tools, you can watch this in the finder by typing open .
  6. make sure that in the 26.0.2 folder there's aidl file added when the process is finished.
  7. it should be working, if not, just rebuild/re-run your code one more time. Done!
于 2018-04-10T20:36:23.287 回答