Google Play Store edit commit 中“500 No individual errors”的原因
Cause of "500 No individual errors" in Google Play Store edit commit
我在 C# 中有一个简单的工具,它使用 Google.Apis.AndroidPublisher.v3 nuget 包将应用程序部署到内部测试轨道,作为我自动构建的最后一步。从我编写工具的 7 月中旬到 9 月中旬(最后一次成功执行:2018-09-17),它一直没有问题。然后我有几个星期没有碰这个应用程序了;截至上周五 (2018-09-28),该工具失败并显示 Google.GoogleApiException
,没有内部异常,消息
Google.Apis.Requests.RequestError
[500]
No individual errors
和堆栈跟踪
at Google.Apis.Requests.ClientServiceRequest`1.<ParseResponse>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Google.Apis.Requests.ClientServiceRequest`1.Execute()
at MyProject.Tools.PlayStoreUploader.Program.Deploy(AndroidPublisherService service, String packageName, String releaseName, FileInfo apkFile, Int32 mainObbVersionCode, FileInfo patchObbFile, String releaseNotes) in C:\dev\MyProject\Tools\MyProject.Tools.PlayStoreUploader\Program.cs:line 211
at MyProject.Tools.PlayStoreUploader.Program.Main(String[] args) in C:\dev\MyProject\Tools\MyProject.Tools.PlayStoreUploader\Program.cs:line 126
基本上完成所有工作的Deploy
方法是
private static void Deploy(
AndroidPublisherService service,
string packageName,
string releaseName,
FileInfo apkFile,
int mainObbVersionCode,
FileInfo patchObbFile,
string releaseNotes)
{
var edits = service.Edits;
// Create a new edit
string editId = edits.Insert(null /* no body */, packageName).Execute().Id;
// Upload new apk
int apkVersion;
using (Stream strm = apkFile.OpenRead())
{
var uploadRequest = edits.Apks.Upload(packageName, editId, strm, MimeTypeApk);
uploadRequest.Upload();
apkVersion = uploadRequest.ResponseBody.VersionCode.Value;
}
// Attach an existing main obb
edits.Expansionfiles.Update(
new ExpansionFile { ReferencesVersion = mainObbVersionCode },
packageName,
editId,
apkVersion,
UpdateRequest.ExpansionFileTypeEnum.Main).
Execute();
// Attach a new patch file
if (patchObbFile != null)
{
using (Stream strm = patchObbFile.OpenRead())
{
edits.Expansionfiles.Upload(
packageName,
editId,
apkVersion,
// This Google API is clearly auto-generated by a badly written tool, because it duplicates the enums.
UploadMediaUpload.ExpansionFileTypeEnum.Patch,
strm,
MimeTypeObb).
Upload();
}
}
// Assign apk to "Internal test" track.
var release = new TrackRelease
{
Name = releaseName,
VersionCodes = new long?[] { apkVersion },
ReleaseNotes = new List<LocalizedText> { new LocalizedText { Language = "en", Text = releaseNotes } },
Status = TrackReleaseStatus.Completed
};
edits.Tracks.Update(
new Track { Releases = new List<TrackRelease> { release } },
packageName,
editId,
TrackIdentifier.Internal).
Execute();
// Publish
edits.Commit(packageName, editId).Execute();
}
相关常量是
const string MimeTypeApk = "application/vnd.android.package-archive";
const string MimeTypeObb = "application/octet-stream";
// As documented at https://developers.google.com/android-publisher/tracks
static class TrackIdentifier
{
public const string Alpha = "alpha";
public const string Beta = "beta";
public const string Internal = "internal";
public const string Production = "production";
}
// As (poorly) documented at https://developers.google.com/android-publisher/api-ref/edits/tracks#resource
// See also https://android-developers.googleblog.com/2018/06/automating-your-app-releases-with.html
static class TrackReleaseStatus
{
/// <summary>Not yet rolled out to anyone</summary>
public const string Draft = "draft";
/// <summary> For staged rollouts to a small percentage of users</summary>
public const string InProgress = "inProgress";
/// <summary> Suspends a staged rollout</summary>
public const string Halted = "halted";
/// <summary> Full rollout</summary>
public const string Completed = "completed";
}
在Deploy
、edits.Commit(packageName, editId).Execute();
的倒数第二行抛出异常。这排除了身份验证失败的原因,因为之前的调用成功了。 edits/commit 的文档列出的可能失败原因是
- You open another edit for the same app after you open this edit
- Any other user commits an edit for the app while your edit is open
- You or any other user makes a change to the app through the Developer Console while your edit is open
但我确定其中 none 个适用。
还有什么可以解释为什么我可以设置编辑,包括上传 APK 和 OBB,但不提交?
这听起来像是 Play 控制台中的错误,正如 500 error code 所证明的那样,这意味着 "Internal Error"。
当出现这种情况时,我建议您联系 Play 管理中心支持人员,让他们知道该问题。您可以通过 Play 管理中心的帮助菜单执行此操作,该菜单位于“?”后面。 (问号)图标。
我在 C# 中有一个简单的工具,它使用 Google.Apis.AndroidPublisher.v3 nuget 包将应用程序部署到内部测试轨道,作为我自动构建的最后一步。从我编写工具的 7 月中旬到 9 月中旬(最后一次成功执行:2018-09-17),它一直没有问题。然后我有几个星期没有碰这个应用程序了;截至上周五 (2018-09-28),该工具失败并显示 Google.GoogleApiException
,没有内部异常,消息
Google.Apis.Requests.RequestError
[500]
No individual errors
和堆栈跟踪
at Google.Apis.Requests.ClientServiceRequest`1.<ParseResponse>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Google.Apis.Requests.ClientServiceRequest`1.Execute()
at MyProject.Tools.PlayStoreUploader.Program.Deploy(AndroidPublisherService service, String packageName, String releaseName, FileInfo apkFile, Int32 mainObbVersionCode, FileInfo patchObbFile, String releaseNotes) in C:\dev\MyProject\Tools\MyProject.Tools.PlayStoreUploader\Program.cs:line 211
at MyProject.Tools.PlayStoreUploader.Program.Main(String[] args) in C:\dev\MyProject\Tools\MyProject.Tools.PlayStoreUploader\Program.cs:line 126
基本上完成所有工作的Deploy
方法是
private static void Deploy(
AndroidPublisherService service,
string packageName,
string releaseName,
FileInfo apkFile,
int mainObbVersionCode,
FileInfo patchObbFile,
string releaseNotes)
{
var edits = service.Edits;
// Create a new edit
string editId = edits.Insert(null /* no body */, packageName).Execute().Id;
// Upload new apk
int apkVersion;
using (Stream strm = apkFile.OpenRead())
{
var uploadRequest = edits.Apks.Upload(packageName, editId, strm, MimeTypeApk);
uploadRequest.Upload();
apkVersion = uploadRequest.ResponseBody.VersionCode.Value;
}
// Attach an existing main obb
edits.Expansionfiles.Update(
new ExpansionFile { ReferencesVersion = mainObbVersionCode },
packageName,
editId,
apkVersion,
UpdateRequest.ExpansionFileTypeEnum.Main).
Execute();
// Attach a new patch file
if (patchObbFile != null)
{
using (Stream strm = patchObbFile.OpenRead())
{
edits.Expansionfiles.Upload(
packageName,
editId,
apkVersion,
// This Google API is clearly auto-generated by a badly written tool, because it duplicates the enums.
UploadMediaUpload.ExpansionFileTypeEnum.Patch,
strm,
MimeTypeObb).
Upload();
}
}
// Assign apk to "Internal test" track.
var release = new TrackRelease
{
Name = releaseName,
VersionCodes = new long?[] { apkVersion },
ReleaseNotes = new List<LocalizedText> { new LocalizedText { Language = "en", Text = releaseNotes } },
Status = TrackReleaseStatus.Completed
};
edits.Tracks.Update(
new Track { Releases = new List<TrackRelease> { release } },
packageName,
editId,
TrackIdentifier.Internal).
Execute();
// Publish
edits.Commit(packageName, editId).Execute();
}
相关常量是
const string MimeTypeApk = "application/vnd.android.package-archive";
const string MimeTypeObb = "application/octet-stream";
// As documented at https://developers.google.com/android-publisher/tracks
static class TrackIdentifier
{
public const string Alpha = "alpha";
public const string Beta = "beta";
public const string Internal = "internal";
public const string Production = "production";
}
// As (poorly) documented at https://developers.google.com/android-publisher/api-ref/edits/tracks#resource
// See also https://android-developers.googleblog.com/2018/06/automating-your-app-releases-with.html
static class TrackReleaseStatus
{
/// <summary>Not yet rolled out to anyone</summary>
public const string Draft = "draft";
/// <summary> For staged rollouts to a small percentage of users</summary>
public const string InProgress = "inProgress";
/// <summary> Suspends a staged rollout</summary>
public const string Halted = "halted";
/// <summary> Full rollout</summary>
public const string Completed = "completed";
}
在Deploy
、edits.Commit(packageName, editId).Execute();
的倒数第二行抛出异常。这排除了身份验证失败的原因,因为之前的调用成功了。 edits/commit 的文档列出的可能失败原因是
- You open another edit for the same app after you open this edit
- Any other user commits an edit for the app while your edit is open
- You or any other user makes a change to the app through the Developer Console while your edit is open
但我确定其中 none 个适用。
还有什么可以解释为什么我可以设置编辑,包括上传 APK 和 OBB,但不提交?
这听起来像是 Play 控制台中的错误,正如 500 error code 所证明的那样,这意味着 "Internal Error"。
当出现这种情况时,我建议您联系 Play 管理中心支持人员,让他们知道该问题。您可以通过 Play 管理中心的帮助菜单执行此操作,该菜单位于“?”后面。 (问号)图标。