Icon files causing gradle build fail in Android Studio on OS X using Google Drive

后端 未结 3 1485
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 17:55

For a college course, I am required to use a Google Drive folder as my project location. The problem is that Google Drive makes my hidden OS X Icon files appear.

When I

相关标签:
3条回答
  • 2021-02-06 18:48

    This is happening because you've set the icon for the folder to something besides the default. Here's an example where I've changed only the drawables icon:

    Setting a custom icon is what creates the Icon file. (It's normally hidden in Finder.)

    To fix this, the easiest thing would be to reset the icon back to the default. To do that, in Finder, right click on the folder and select "Get Info". This will bring up the info window. Select the folder icon in the upper left by clicking on it, then in the top bar menu do Edit -> Cut. Here's an image to show the info window with the icon selected:

    That should reset the icon and fix your problem.

    Another approach is to clean out all the icons under a specific folder. On the command line, change directories to the top level folder. Then run find . -name Icon\* -delete. Note this will delete any file starting with the work Icon. To test what files will be deleted, you can first run find . -name Icon\* by itself to get a list.

    It may be that an unknown application is updating the icons (see comments). The command line listed above can be used to clean up the icons on a regular basis.

    0 讨论(0)
  • 2021-02-06 18:54

    These are the solutions we developed, based on Hod's answer.

    Getting rid of all current Icon files

    1. Open a terminal window in the parent folder to your projects.
    2. To look for Icon files, execute: find . -name Icon\*
    3. If you get any results, execute: find . -name Icon\* -delete

    Automatically removing future Icon files

    1. Open a terminal window in the parent folder to your projects.
    2. Copy and paste in this incantation ( (adapted from https://stackoverflow.com/a/9625233/631051), which will delete Icon files every minute: (crontab -l 2>/dev/null; echo "*/1 * * * * find . -name Icon\* -delete") | crontab -

    To undo, enter the following incantation (adapted from https://askubuntu.com/a/719877/43296) in a terminal window (in any folder): crontab -l | grep -v Icon | crontab -

    Assumptions

    All of this assumes that you have:

    • no files whose names start with Icon in your projects hierarchy that you want to keep.
    • no cron jobs involving Icon that you want to keep.
    0 讨论(0)
  • 2021-02-06 18:54

    Try excluding the files or directory or folder from being compiled. In your app build.gradle file try to exclude those files. You can try the check these links 1 2 3

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