Android - 403 when requesting map image with valid API key
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm trying to load a static map API image, but it keeps 403-ing, which seems to be because of an invalid API key (based on the docs https://developers.google.com/maps/documentation/maps-static/error-messages)
I've verified in the console that the API key is valid and non-expired. The url https://maps.googleapis.com/maps/api/staticmap?center=47.3,-122.359&zoom=12&size=411x231&maptype=roadmap&mobile=true&scale=2&key=xxxxx loads fine in the browser, so I take that to mean that the API key is valid.
The API key lives in the AndroidManifest.xml
file
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxx"/>
Anyone else experience this?
android google-maps google-static-maps
add a comment |
I'm trying to load a static map API image, but it keeps 403-ing, which seems to be because of an invalid API key (based on the docs https://developers.google.com/maps/documentation/maps-static/error-messages)
I've verified in the console that the API key is valid and non-expired. The url https://maps.googleapis.com/maps/api/staticmap?center=47.3,-122.359&zoom=12&size=411x231&maptype=roadmap&mobile=true&scale=2&key=xxxxx loads fine in the browser, so I take that to mean that the API key is valid.
The API key lives in the AndroidManifest.xml
file
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxx"/>
Anyone else experience this?
android google-maps google-static-maps
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57
add a comment |
I'm trying to load a static map API image, but it keeps 403-ing, which seems to be because of an invalid API key (based on the docs https://developers.google.com/maps/documentation/maps-static/error-messages)
I've verified in the console that the API key is valid and non-expired. The url https://maps.googleapis.com/maps/api/staticmap?center=47.3,-122.359&zoom=12&size=411x231&maptype=roadmap&mobile=true&scale=2&key=xxxxx loads fine in the browser, so I take that to mean that the API key is valid.
The API key lives in the AndroidManifest.xml
file
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxx"/>
Anyone else experience this?
android google-maps google-static-maps
I'm trying to load a static map API image, but it keeps 403-ing, which seems to be because of an invalid API key (based on the docs https://developers.google.com/maps/documentation/maps-static/error-messages)
I've verified in the console that the API key is valid and non-expired. The url https://maps.googleapis.com/maps/api/staticmap?center=47.3,-122.359&zoom=12&size=411x231&maptype=roadmap&mobile=true&scale=2&key=xxxxx loads fine in the browser, so I take that to mean that the API key is valid.
The API key lives in the AndroidManifest.xml
file
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxx"/>
Anyone else experience this?
android google-maps google-static-maps
android google-maps google-static-maps
asked Nov 16 '18 at 21:42
Lady_ariLady_ari
2742619
2742619
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57
add a comment |
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57
add a comment |
2 Answers
2
active
oldest
votes
Can you post code for how you are accessing and building the url to be sent?
Also if you are on a premium plan, then you will need to add a signature metadata field as described here: https://developers.google.com/maps/documentation/maps-static/get-api-key?hl=en_US#dig-sig-key.
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in theAndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.
– Lady_ari
Nov 16 '18 at 22:09
add a comment |
So, I did a bit of digging, and it seems like Google made a change in June of this year where the url now requires the key to be sent. They no longer support keyless usage. This is terrible, since it breaks older app versions that used the old structure.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345821%2fandroid-403-when-requesting-map-image-with-valid-api-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Can you post code for how you are accessing and building the url to be sent?
Also if you are on a premium plan, then you will need to add a signature metadata field as described here: https://developers.google.com/maps/documentation/maps-static/get-api-key?hl=en_US#dig-sig-key.
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in theAndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.
– Lady_ari
Nov 16 '18 at 22:09
add a comment |
Can you post code for how you are accessing and building the url to be sent?
Also if you are on a premium plan, then you will need to add a signature metadata field as described here: https://developers.google.com/maps/documentation/maps-static/get-api-key?hl=en_US#dig-sig-key.
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in theAndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.
– Lady_ari
Nov 16 '18 at 22:09
add a comment |
Can you post code for how you are accessing and building the url to be sent?
Also if you are on a premium plan, then you will need to add a signature metadata field as described here: https://developers.google.com/maps/documentation/maps-static/get-api-key?hl=en_US#dig-sig-key.
Can you post code for how you are accessing and building the url to be sent?
Also if you are on a premium plan, then you will need to add a signature metadata field as described here: https://developers.google.com/maps/documentation/maps-static/get-api-key?hl=en_US#dig-sig-key.
answered Nov 16 '18 at 22:01
Eric CEric C
12
12
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in theAndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.
– Lady_ari
Nov 16 '18 at 22:09
add a comment |
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in theAndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.
– Lady_ari
Nov 16 '18 at 22:09
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in the
AndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.– Lady_ari
Nov 16 '18 at 22:09
So, I did a bit of digging, and it seems like Google changed it so that the url requires the key to be sent on Android as well. It's no longer enough to have the API key in the
AndroidManifest.xml
file. This is terrible, since it breaks older app versions that used the old structure.– Lady_ari
Nov 16 '18 at 22:09
add a comment |
So, I did a bit of digging, and it seems like Google made a change in June of this year where the url now requires the key to be sent. They no longer support keyless usage. This is terrible, since it breaks older app versions that used the old structure.
add a comment |
So, I did a bit of digging, and it seems like Google made a change in June of this year where the url now requires the key to be sent. They no longer support keyless usage. This is terrible, since it breaks older app versions that used the old structure.
add a comment |
So, I did a bit of digging, and it seems like Google made a change in June of this year where the url now requires the key to be sent. They no longer support keyless usage. This is terrible, since it breaks older app versions that used the old structure.
So, I did a bit of digging, and it seems like Google made a change in June of this year where the url now requires the key to be sent. They no longer support keyless usage. This is terrible, since it breaks older app versions that used the old structure.
answered Nov 16 '18 at 22:11
Lady_ariLady_ari
2742619
2742619
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345821%2fandroid-403-when-requesting-map-image-with-valid-api-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The error might occur if you did not enable your billing account or if you reached your self-imposed usage cap.
– Shawn Domingo
Jan 22 at 0:57