admin管理员组

文章数量:1122832

I tried setting up an API-key for Google Cloud that can be used from my Expo-managed android app. I got the fingerprint by running eas credentials and set the restriction in Google Cloud to only Match android apps with this fingerprint.

When implementing react-native-geocoding, I got the following error when trying to fetch data from the API:

this ip, site or mobile application is not authorized to use this api key. request received from ip address XX.XX.XX.XXX, with empty referer with status REQUEST_DENIED.

When I remove the restrictions for the API-key, I can easily access the API.

What could be causing this? Am I maybe using the wrong fingerprint for the development version? If so, where can I find the correct one?

I tried setting up an API-key for Google Cloud that can be used from my Expo-managed android app. I got the fingerprint by running eas credentials and set the restriction in Google Cloud to only Match android apps with this fingerprint.

When implementing react-native-geocoding, I got the following error when trying to fetch data from the API:

this ip, site or mobile application is not authorized to use this api key. request received from ip address XX.XX.XX.XXX, with empty referer with status REQUEST_DENIED.

When I remove the restrictions for the API-key, I can easily access the API.

What could be causing this? Am I maybe using the wrong fingerprint for the development version? If so, where can I find the correct one?

Share Improve this question asked Nov 22, 2024 at 16:59 JaRoMasterJaRoMaster 1811 gold badge4 silver badges32 bronze badges 2
  • Have you created android key or browser key? – Suraj Commented Nov 25, 2024 at 2:24
  • @Suraj I used Expo EAS to build the app which generates the key. For another build, I used expo prebuild, which led to another key being created that also didn't work – JaRoMaster Commented Nov 25, 2024 at 19:27
Add a comment  | 

1 Answer 1

Reset to default 0

Run .\\gradlew.bat signingReport or ./gradlew signingReport to get the SHA-256 fingerprint. While you might have restricted the API key to a specific IP address, which makes no sense for a mobile application: https://developers.google.com/maps/documentation/geocoding/get-api-key

Instead of a completely unrestricted API key, one should put a public web-server in between.

本文标签: androidGoogle Cloud API does not recognize my Expo SHA1 fingerprintStack Overflow