Android Studio 3.2.1 - Cannot sync project with gradle files: Argument for @NotNull parameter 'message' of … must not be null

℡╲_俬逩灬. 提交于 2019-12-01 02:36:11

Ok, I was finally able to figure out the reason.

The problem was, that my project folder resided on a different hard disk partition, than my home folder. The folder containing my android projects was linked to my home folder with a symbolic link.

I can't tell whether its the symbolic link, or the other partition, that is causing the problem. I haven't checked that. Maybe it works if you have it on the same partition but linked with a symbolic link. Maybe it works when used on another partition without symbolic links. But for anyone experiencing this problem -> Check if one of these might be your cause as well.

Some extra information: My android project folder resided on a hard disk partition formatted with ZFS.

I saw a version of this with just now on Android Studio 3.4: the only error message I saw in the IDE was that Gradle sync failed, but in idea.log there was a NullPointerException and its traceback originated at com.intellij.openapi.extensions.Extensions.disposeArea and was just like the one in the question.

The fix that worked for me:

  1. rm .idea/modules.xml

  2. Then try Gradle sync again.

This also caused that file to get automatically regenerated. The new version had exactly the same entries as the old, plus some additional ones for various library dependencies. Not sure if those entries being absent was the cause of the issue, or an unrelated accident.

Before that, I tried "Invalidate Caches / Restart...", and it didn't work in my case. Also double-checked and there are no symbolic links in my project path, or the paths to Android Studio or the Android SDK.

Had a similar problem after renaming the project folder and adding the renamed folder as new project.

  • solved this by the infamous "Invalidate Caches / Restart" option

(before I removed the old project link which was not enough)

check this : Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null

by the way , i usually delete .idea and .gradle folders inside my project folder after updating android studio , almost works for all new bugs after updating .

Faced same issue, wasted a day reinstalling everything and figured out just now. It happens if you create a symbolic link to your project and specify the path through that symbolic link. Just specify the project path by going the long way and everything will work just fine.

I had the same problem. I move the ~/Android/Sdk folder to a different partition and placed a symbolic link!!!

Solution for me: Delete .android , .AndroidStudio3.2 , .gradle folders Start studio.sh again and let it initialize things as for the first time. Then go to File->settings->System Settings->Android SDK and give the new location to the Android SDK folder as an absolute path (not symbolic links).

After this, it worked like charm.

I solved the problem by rename the project folder and then reopen android studio , android studio will tell you that it can not find the project , then remove the project from the android studio current open list . rename project folder back and open it by android studio again .

I got same issue in Android Studio 3.4. I managed to fix it by restoring my previously deleted app-name.iml file.

I also had the same problem and simply resolved it by closing android studio, deleting .idea and .gradle files located on the project folder and then reopening android studio.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!