可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

I'm using IntelliJ IDEA Pro 13.1.2. Never used any versions below 13.

When trying to run build.gradle from IDE I get the message: Module is not backed by gradle

I can run this script from the command line just fine.

The "root" directory has both .gradle and gradle sub-directories and, in general its structure is very similar to another module from the same project where I can run its build from IDE without problems.

Any suggestions on further troubleshooting?

回答1:

If you didn't set up the IDE project via "Import Project" and then pointing to a Gradle project, you may have to link the IDE project to the Gradle project. This can be done in the "Gradle" window.

回答2:

The answer that worked for me is to restart IntelliJ - at startup build.gradle is identified and the project is set up.

The only thing that worked for me was to use the menu File > Close Project and reopen it. IDEA popped up a dialog saying "Import project from Gradle files" or something to that effect.

Dead ends: Below is a list of dead ends, so don't waste your time with them. I kept seeing "module is not backed by gradle" despite following all these dead ends. At the time of this reading, none of these answers worked: There was no Gradle tool window, so I couldn't synchronize the project

Clicking File > Open gradle.build opens the file for editing and doesn't solve the issue

Creating a run configuration that runs gradle has no effect, even after I saw a build/ folder created

Runing ./gradlew from the commandline only creates files for gradle and doesn't fix IntelliJ

回答3:

I fixed this problem by clicking in the Menu --> "Run" --> "Edit Configurations" --> [+] The little plus in the top left corner --> "Gradle"

With the new created run configuration it worked. I hope this will help some of you.

回答4:

Tools > Grails > Change SDK Version

回答5:

For a non-gradle project, you can also remove the module from the project and re-import it. This will help avoid the message "module is not backed by gradle".

回答6:

Like others have said, none of the other answers worked for me. The only thing that worked was:

Close the project, then import it as a Gradle project.

回答7:

I'm using android studio, intellij. Try this: Tools > Android > (sync project with gradle files)

Run gradle build

回答8:

Do not select the project directory when importing

Select the gradle file to import as a Gradle project

I always use Local Gradle Distribution and Offline work to build, then switch back.

It will auto build and you will see the gradle task in task window.

Hope it works for you.

回答9:

This problem happened for me because I chose a different name for my project than my artifactID. In order to prevent this problem to happen, make sure your project name is the same as your artifactID.

回答10:

You may have originally created the project via File->New->Project From Version Control. This doesn't seem to always set the project up as a Gradle project, even if there is a build.gradle in the root directory. To solve this:- Close IntelliJ.

Delete the .idea folder in the project.

Start IntelliJ and select 'Open'.

Navigate to the project folder and open it.

The project will be recognised as Gradle and be set up as such.

is not backed by gradle android,Module … is not backed by gradle相关推荐

  1. android卡在gradle,Android Studio打开新项目卡在Gradle的问题

    小提示:如果是开在Indexing这个位置,可以 File--> Invalidate Caches/Restart--> Invalidate and Restart. 如果卡在 Gra ...

  2. Gradle Android客户端程序打包(基于gradle 2.10版本验证通过)

    http://www.cnblogs.com/Freedoms/p/5171201.html 一.前言 目前正在准备从eclipse开发环境向AndroidStudio迁移,提前过去探探路,不出所料, ...

  3. Idea关于Module is not backed by gradle的问题

    公众号,欢迎关注 背景: 有一个Maven项目,想引入Gradle作为构建工具,添加builde.gradle文件 现象 运行时Idea报错,Module is not backed by gradl ...

  4. Idea关于Module is not backed by gradle的问题(部分转)

    背景: 有一个Maven项目,想引入Gradle作为构建工具,添加builde.gradle文件 现象 运行时Idea报错,Module is not backed by gradle 解决方案 关闭 ...

  5. 【Android Gradle 插件】工程根目录下 build.gradle 配置文件 ( 远程仓库配置 | 依赖配置 | 所有子模块配置 | task clean 任务 )

    文章目录 一.工程根目录下 build.gradle 配置文件 1.基本作用 2.远程仓库配置 3.依赖配置 3.所有子模块配置 4.task clean 任务 Android Plugin DSL ...

  6. 【错误记录】Android Studio 编译报错 ( Invalid Gradle JDK configuration found )

    文章目录 一.报错信息 二.解决方案 一.报错信息 Android Studio 编译时提示 Invalid Gradle JDK configuration found 错误 ; 一般是打开一个新的 ...

  7. Android Gradle 学习笔记(四):Gradle 构建脚本

    本节我们从整体的角度来介绍一下Gradle. 一.setting.gradle 在Gradle中,定义了一个设置文件,用于初始化以及工程树的配置.设置文件的默认的名字就是setting.gradle, ...

  8. Android Studio下项目构建的Gradle配置及打包应用变体

    Gradle简介   Gradle是一个自动化构建工具,采用Groovy的Domain Specific Language(领域特定语言)来描述和控制构建逻辑.具有语法简洁.可读性强.配置灵活等特点. ...

  9. linux 搭建gradle android jenkins打包机器,gradle 依赖 jar问题

    app/build.gradle文件 apply plugin: 'com.android.application'android {compileSdkVersion 25buildToolsVer ...

最新文章

  1. 掌握ConstraintLayout(十)按比例设置视图大小
  2. Python全栈 MySQL 数据库 (索引、数据导入、导出)
  3. zookeeper源码
  4. Vue 3 —— 当 data 和 ref 相同时 运行时错误 [ReferenceError: xxx is not defined]
  5. 2017蓝桥杯省赛---java---A---7(正则问题)
  6. node作为java中间间_node作为中间服务层如何发送请求(发送请求的实现方法详解)...
  7. 关于RESTful一些注意事项,接口开发规范
  8. idea中.ignore插件的使用
  9. InfoPath读取数据库
  10. tomcat工作原理以及详解操作
  11. mysql更换主键遇到的一个问题
  12. python你!_你都用 Python 来做什么?
  13. Matlab如何多行添加注释和取消注释
  14. cmd命令查询电脑序列号_如何查看台式电脑序列号
  15. 智象运维干货 | HP iLo4 Smash CLP命令行参考
  16. 免费个人简历模板、PPT模板网址大全
  17. nginx代理内网服务器的图片服务器
  18. 旷视研究院「技术圆桌派-上海专场 」报名启动!
  19. 摄像头集中监控软件系统
  20. 遍历文件夹打印所有文件名

热门文章

  1. 如何使用JavaScript实现前端导入和导出excel文件(H5编辑器实战复盘)
  2. 高压水冷加热器行业研究及十四五规划分析报告
  3. HDU 6833 莫比乌斯反演 + 数论分块
  4. matlab shading颜色设置,关于matlab中pcolor显示图片时的shading设置问题
  5. linux网络音频播放,通过 PulseAudio 实现局域网音乐播放
  6. linux的命令名必须是小写英文字母,Linux常用命令及操作
  7. 计算机开机总要按f1键,为什么开机要按f1键?win7每次开机按f1才能进入系统怎么办...
  8. 详细讲解vue2组件通信(一)——父传子props
  9. PLG软件的运行环境设置
  10. MOS管推挽电路设计及特性解析