Search code examples
javaandroidgoogle-sheets-apicredentials

Resource not found: /credentials.json Google Sheets API


I follow the google Sheets quickstart and download the credentials.json put in my project main/res. No matter how I change the place, it always shows the error java.io.FileNotFoundException: Resource not found: /credentials.json

I have tried the other way that I found in this post: java.io.FileNotFoundException: Resource not found: /credentials.json on Java QuickStart for Classroom API

But still the same. Can anyone tell me how to fix it? I google it for a long time. Thanks enter image description here


Solution

  • You are storing the credentials.json file in the main app folder but, as you can see in the corresponding Java Quickstart for Sheets API, this file should be in src/main/resources/.

    Your issue should be solved by moving the file to the specified location.