该请求未指定任何Android软件包名称或签名证书指纹。请确保客户端正在发送它们,或使用API控制台更新您的密钥限制
// 我想我已经正确分配了程序包名称和密钥。
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=9&chart=mostPopular&q=®ionCode=KR&type=video&pageToken=&key=AIzaSyCgfBMMgbhREQ-WoztivqyscWN2auEFlIo
W/user.easyforyo: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection)
D/OkHttp: --> GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=9&chart=mostPopular&q=®ionCode=KR&type=video&pageToken=&key=AIzaSyCgfBMMgbhREQ-WoztivqyscWN2auEFlIo http/1.1
--> END GET
D/AAAAA: onResume
D/OpenGLRenderer: Skia GL Pipeline
W/user.easyforyo: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection)
E/RecyclerView: No adapter attached; skipping layout
D/: HostConnection::get() New Host Connection established 0xe6b11980, tid 5595
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xe6b7e440: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xe6b7e440: ver 3 0 (tinfo 0xee952d60)
D/AAAAA: onCreateOptionsMenu
W/user.easyforyo: Accessing hidden method Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged()V (light greylist, reflection)
Accessing hidden method Landroid/widget/AutoCompleteTextView;->doAfterTextChanged()V (light greylist, reflection)
Accessing hidden method Landroid/widget/AutoCompleteTextView;->ensureImeVisible(Z)V (light greylist, reflection)
W/user.easyforyo: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection)
D/EGL_emulation: eglMakeCurrent: 0xe6b7e440: ver 3 0 (tinfo 0xee952d60)
D/OkHttp: <-- 403 https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=9&chart=mostPopular&q=®ionCode=KR&type=video&pageToken=&key=AIzaSyCgfBMMgbhREQ-WoztivqyscWN2auEFlIo (459ms)
D/OkHttp: vary: Origin
vary: X-Origin
content-type: application/json; charset=UTF-8
date: Mon, 13 May 2019 22:33:42 GMT
expires: Mon, 13 May 2019 22:33:42 GMT
cache-control: private, max-age=0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
server: GSE
alt-svc: quic=":443"; ma=2592000; v="46,44,43,39"
D/OkHttp: {
"error": {
"errors": [
D/OkHttp: {
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=1036386000837"
}
],
D/OkHttp: "code": 403,
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions."
答案 0 :(得分:0)
对于那些在Google Geolocation API服务中出现此错误的人:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=1234567890"
}
],
"code": 403,
"message": "The request did not specify any Android package name or signing-certificate fingerprint. Please ensure that the client is sending them or use the API Console to update your key restrictions."
}
}
在Google开发者控制台中打开您的项目(在链接上),然后单击API库按钮(您将转到类似https://console.developers.google.com/apis/library?project=your_project的链接)。
单击“ Places API”,然后在页面底部单击“地理编码API”并启用它。单击后,将显示使用情况图表。然后我禁用了它,因为它是付费选项。