android 模块不编译错误,Android studio错误“检测到不支持的模块:以下模块不支持编译”...

First of all you should update to Android Studio 1.2

Source: https://code.google.com/p/android/issues/detail?id=77983

Then you should go to File -> Invalidate Caches / Restart -> Invalidate Caches & Restart.

Then try to build the application again.

1- close the project

2- close Android Studio IDE

3- delete the .idea directory

4- delete all .iml files

5- open Android Studio IDE and import the project

Invalidate Caches and Restart did not work for me. I also updated all my Android Studio files with no success.

The solution I found was importing the android folder by clicking "Import project (Eclipse ADT, Gradle, etc.)" rather than clicking "Open an existing Android Studio Project" or dragging the folder onto the app icon.

Apparently the problem is caused because a module in the project has an *.iml file that does not contain external.system.id="GRADLE".

When you import the project (as opposed to opening it), the iml files are completely re-written, thus removing the error.

Try this if it helps File -> Invalidate Caches / Restart.

If it still doesn't help click on the button in the image.

'Sync Project with Gradle Files'

f42d199d3cb2ed65b3ab499d4ae79af3.png

i know it's old question. but i faced this problem after updating to Android Studio 3.0 . i solved it by deleting app.iml file inside my app module and then Invalidate Caches / Restart.

If the above doesn't help you - check your module .iml file and see if it contains any errors. (for the app module it will be app.iml).

Close the Android Studio and Move ".idea" Folder and paste it outside Project root folder( For Back up if you need).

Open the Android studio.

On Opening the project it"ll ask add module (app) to your project. You can ignore the same.

It set set default build variant to be "debug".

You can see build variant tab on left corner or hover on "Monitor" Symbol on left bottom

Note: No need to change your .iml file of your project.tom to get build variant option and "Invalidate Cache and Restart" will also not work rather it will clear your history files too!.

I solved a similar problem by closing the project, then re-importing the project (not opening, but re-importing as an eclipse or other project)

You should import the the project

This error shows up when there is a module in your project whose .iml file does not contain:

external.system.id="GRADLE" Can you please check your .iml files? Also, instead of opening the project, import it, that will completely rewrite your .iml files and you won't see that error again.

For windows users, this can also be caused by filesystem corruption.

If all steps above do not correct the error:

Close Android Studio

Open Command Prompt as Administrator

Run a chkdsk /f on the drive your app is stored

Delete .idea folder

Restart Android Studio

You can update new version of Android studio then go to invalidate catches/restart.Click sync button build application.

I had the same issue on androidStudio 3.2 and clonning the project worked for me

Step 1 : Delete .iml file

Step 2 : Check if your Project Directory Contain any white spaces if so then Rename your project directory leaving space

ex:

Before : My Project

After rename : MyProject

and open Android Studio...

In my case I cloned a git-project where both Java and Kotlin included. Then checked another branch and pressed "Sync Project with Gradle Files". Android Studio 3.0.1.

Check in build.gradle in app you have good compile link .I have mistake with this line compile 'com.android.support:support-annotations:x.x.x' delete and work.

In my case it is because the root project name have a space.

So instead of naming it as sample project, it should be sample-project or sample_project.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值