Reputation: 4007
Actually by mistake I pasted google-services json file of another project in my current project of android .So when building the app , i get error no matching client found for package 'com.mybidu.www'. I tried to delete the file but it gives error 'Java IO Exception Cannot delete google-services.json ' Nor does it allow me to overwrite the same file . What should i do ?
Upvotes: 11
Views: 21819
Reputation: 81
Open Task Manager (Press Alt + Ctr + delete) and end the running JDK process and try again the android platform removal
Upvotes: 8
Reputation: 65
Delete apply plugin: 'com.google.gms.google-services'trong text from build.gradle, sync and then delete google-services, then add again apply plugin: 'com.google.gms.google-services'
Upvotes: 4
Reputation: 14668
OpenJDK has grabbed hold of that file, and won't allow the OS to delete it. So, you need to first kill the OpenJDK process using Task Manager. Careful, there are two processes to kill, both starting with "OpenJDK".
Upvotes: -1
Reputation: 3401
Simple solution: first of all, you have to restart Android Studio and then you will be able to remove the google-service.json file in your project.
Upvotes: 0
Reputation: 238
I suffered from that problem. So, I get one way to solve because it will not solve by deleted from the folder.
Just copy all content of your new JSON file to OLD one which one not deleted
Then go to BUILD option and Click on REBUILD
It works for me.I hope it will work for you as well.
Upvotes: -1
Reputation: 1828
The error is due to the fact your google-services.json file is open in any background process may be in openJDK binary which doesn't allow it to delete. You can solve this issue without deleting the json file rather replace the content of your old google-services.json file with the new one and rebuild the project.
Upvotes: 4
Reputation: 76
This worked for me. Close Android Studio. Open Android Studio. Overwrite the file again. This time the file is not locked. And there should be no error.
Upvotes: -1
Reputation: 1906
Step 1. Close your Android Studio.
Step 2. Go to the location of the project.
Step 3. Delete the google-services.json
It will get deleted without any problem.
Cheers!
Upvotes: 7
Reputation: 2815
First you have to just download the new fresh google-services.json.
then copy the file.
paste it into Project view -> app folder in your android-studio app.
It will overwrite your existing file
Suppose you are not able to do it, just do this.
That json file referenced in android-studio cache so once close your android studio and then delete this file it will delete.. Hope it will help you...
Upvotes: 11