2

I came across this strange issue, I have a very large Android git repo, there is a libs folder which contains a jar file. I cloned this repo to my local and it works all right till one day there is Gradle and Android Studio upgrade. After upgrading, my project can't build because of missing this jar file.

I never deleted this jar file, but from git status, it shows

Changes not staged for commit:

(use "git add/rm ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working directory)

`deleted:    XXXRedLaser/libs/redlasersdk.jar`

So I checkout it, then I do git status again. It shows me exactly same status information. Then I realize, every time I check it out, immediately, it gets deleted right after check out.

Then I started a new local repo and git clone the project into it. After cloning, first thing I do is git status, guess what, the jar gets deleted already and status is the same as above!

I ask my colleague to git clone and test, it works all right on his laptop, the Jar is not deleted.

(I have checked git ignore file, jar file is not ignored. I am pretty sure above behavior has nothing to do with git ignore. And this should also has nothing to do with IDE because I check everything from command line)

Anyone has any clue what should I do and what should I check ?

Acton
  • 255
  • 4
  • 13
  • Is it because of your gradle cache? (https://stackoverflow.com/a/30450020/6309) – VonC Oct 15 '18 at 04:34
  • do you have a antivirus on your laptop ? – Shayan Tabatabaee Oct 15 '18 at 07:14
  • @Vonc I have tried that, after clear gradle cache and re downloading all dependencies, issue remains. This Jar file is not any gradle dependency, it is a file form the repo. – Acton Oct 15 '18 at 15:59
  • @ShayanTabatabaee I have tested by putting this file in a different location and it would not be deleted, and I have asked security guy no pre-installed security software would delete anything file, it will only block the thread. – Acton Oct 15 '18 at 16:00
  • @ShayanTabatabaee There is a bitdefender running on my laptop which I somehow installed and don't know its existence. It recognize my jar file as trojan virus and keep deleting it! thank you for pointing out the right way – Acton Oct 15 '18 at 21:38
  • @Acton : I'm glad that you solved your problem , and you can also change the permission of your jar file to readonly so your antivirus will never delete that :-) – Shayan Tabatabaee Oct 16 '18 at 10:33

1 Answers1

1

Turns out I have a anti-virus software BitDefender running and keep detecting my jar file as trojan virus. If git add it, it will get deleted immediately. but if I download and add the jar file, it would not get deleted. This finally ends 3 days' confusion and debugging.

Acton
  • 255
  • 4
  • 13