我收到了谷歌应用脚本的以下错误。我的代码工作不久前,但当我切换到另一台计算机时,它打破了一切。现在我不知道它为什么会出现以下错误:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Google Apps Script Execution API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/script/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason" : "forbidden"
} ],
"message" : "Google Apps Script Execution API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/script/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status" : "PERMISSION_DENIED"
}
尝试访问我的脚本,将一些数据保存到Google表格中。这个项目编号甚至不属于我。我不知道它来自哪里或它属于什么。
任何人都知道这个错误意味着什么?如果您需要更多信息,请告诉我,我可以提供
编辑:
我发现了我的问题。在我的Android代码中,我在设置应用程序名称时输入了拼写错误。纠正这一点后,它正确链接到正确的项目,一切都恢复正常
答案 0 :(得分:1)
好的,我找到了这个解决方案,为应用添加了两种不同的风格:
productFlavors {
prod {
applicationId "tld.domain.appname"
}
demo {
applicationId "tld.domain.appnamedebug"
}
}
答案 1 :(得分:0)
您需要启用API以允许使用此功能。谷歌允许几次,但稍后会阻止。看看这里: https://developers.google.com/drive/v3/web/enable-sdk