在根项目 Android Studio 上找不到参数 [:app] 的方法 include()

在根项目 Android Studio 上找不到参数 [:app] 的方法 include()

问题描述:

我正在尝试将一个 android 项目导入到 Android studio,导入后点击绿色运行按钮:

I am trying to import an android project to Android studio,after importing and then clicking on the green run button :

FAILURE: Build failed with an exception.

  • 地点:
  • 构建文件'/home/myusername/prjcts/nomadx/settings.gradle' 行:1

    Build file '/home/myusername/prjcts/nomadx/settings.gradle' line: 1

    • 出了什么问题:评估根项目nomadx"时出现问题.
    • 在根项目 'nomadx' 上找不到参数 [:app] 的方法 include().

      Could not find method include() for arguments [:app] on root project 'nomadx'.

      文件内容settings.gradle

include ':app'

我解决了问题;对于那些有同样问题的人:您应该使用终端/控制台而不是 Android studio 构建 gradle :

I solved the problem ; for those who have the same issue : You should build the gradle with the Terminal/console not with Android studio :

./gradlew assembleRelease