内容简介:偶然在StackOverFlow看到一个奇葩问题,下面有一个回答:所以就解决了呀,不要用软链接打开就行了,Gradle不支持软链接文件夹。无语
错误信息
Argument for @NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null java.lang.IllegalArgumentException: Argument for @NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null at com.android.tools.idea.gradle.project.sync.GradleSyncState.$$$reportNull$$$0(GradleSyncState.java) at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncFailed(GradleSyncState.java) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.doPopulateProject(IdeaSyncPopulateProjectTask.java:135) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populate(IdeaSyncPopulateProjectTask.java:97) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.access$000(IdeaSyncPopulateProjectTask.java:39) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask$1.run(IdeaSyncPopulateProjectTask.java:86) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
情境
之前这几个android项目是在windows上编写的,切换到 linux 环境之后继续做开发。
我把这个分区挂载到/media/user/data
之后,为了方便使用,创建了一个软链接
/home/user/data/
打开项目是从这个软链接打开的,结果每次都build不了,我还以为我电脑出了什么问题,Google无果。
偶然在StackOverFlow看到一个奇葩问题, # [Android Studio build error on NTFS partition](https://stackoverflow.com/questions/52721989/android-studio-build-error-on-ntfs-partition)
I’m having problems building apps on Android Studio. Things work fine when the project is on my ext4 partition, but when I created a new one on my NTFS, I encountered this: The error disappeared when I restarted Android Studio, but after that I still cannot run my app (the project structure in the sidebar is not displayed properly). I’m using Android Studio 3.2 on Ubuntu 18.04.1.
下面有一个回答:
I figured it out. (By mistake, to be honest…) Let’s say you have an NTFS partition mount at /mnt/ntfs, and your project is at /mnt/ntfs/projects/project. Your home partition (ext4) is mounted at /home, your home directory is /home/user and you have a symbolic link at /home/user/projects that points to /mnt/ntfs/projects. The reason I (and hopefully you too) have encountered this error is that when using Android Studio’s “Open Project…” option, I provided the symbolic link (/home/user/projects/project). When trying to provide the real path (/mnt/ntfs/projects/project) the gradle sync succeeded. So to fix this for now, simply provide the real path. However, this should probably be addressed by IntelliJ or the developers of Gradle.
解决
所以就解决了呀,不要用软链接打开就行了,Gradle不支持软链接文件夹。无语
About
了解更多有趣的操作请关注我的微信公众号:DealiAxy
每一篇文章都在我的博客有收录:blog.deali.cn
以上所述就是小编给大家介绍的《记一次AndroidStudio在Linux环境上的奇葩错误,Argument for @NotNull parameter 'message' of》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
激荡十年,水大鱼大
吴晓波 / 中信出版社 / 2017-11-1 / CNY 58.00
【编辑推荐】 知名财经作者吴晓波新作,畅销十年、销量超过两百万册的《激荡三十年》续篇,至此完成改革开放四十年企业史完整记录。 作为时代记录者,吴晓波有意识地从1978年中国改革开放伊始,记录中国翻天覆地的变化和对我们影响至深的人物与事件,串成一部我们每个人的时代激荡史。而最新的这十年,无疑更壮观,也更扑朔迷离。 很多事情,在当时并未有很深很透的感受,回过头来再看,可能命运的轨迹就......一起来看看 《激荡十年,水大鱼大》 这本书的介绍吧!