java.lang.IllegalArgumentException: Parameter 'directory' is not a directory in android

后端 未结 2 1526
既然无缘
既然无缘 2020-12-17 09:20

I rebuilt my project and got this error. I\'m unable to find where it\'s coming from. The full log is:

Caused by: jav         


        
相关标签:
2条回答
  • 2020-12-17 09:47

    I've had the same problem. All I did was:

    1. Delete the .gradle directory
    2. Invalidate Caches and restart Android Studio.
    0 讨论(0)
  • 2020-12-17 09:53

    Your "File" type should reference to a FOLDER and not a FILE. Android Source Code does this:

    if (!directory.isDirectory()) {
        throw new IllegalArgumentException("Parameter 'directory' is not a directory: " + directory);
    }
    

    so you are passing a File variable that doesn't points to a Folder but a something else.

    0 讨论(0)
提交回复
热议问题