Google.Apis.Requests.RequestError : Track names in request path and request body must match
See original GitHub issueHello,
I have been using this nuget package for quite a while and since few days, I am not able to upload any APK. My code didn’t change, just the error appears after I updated the nuget package.
I got this exception :
Google.Apis.Requests.RequestError Track names in request path and request body must match. [400] Errors [ Message[Track names in request path and request body must match.] Location[ - ] Reason[badRequest] Domain[global]]
Here is my code :
public IUploadProgress UploadAPK(AppEdit edit, string packageName, string versionName, Stream file, string releaseNotes, string track)
{
// Upload APK
var uploadedApk = this.Service.Edits.Apks.Upload(
packageName,
edit.Id,
file,
"application/octet-stream");
// Upload Callback
uploadedApk.ResponseReceived += (apk) =>
{
if (apk == null)
{
return;
}
// Get VersionCode
List<long?> apkVersionCodes = new List<long?> { apk.VersionCode };
// Create Realease Note
LocalizedText note = new LocalizedText();
note.Language = LANG_FR;
note.Text = releaseNotes;
var updatedTrack = this.Service.Edits.Tracks.Update(
new Track()
{
Releases = new List<TrackRelease>
{
new TrackRelease
{
Name = versionName,
VersionCodes = apkVersionCodes,
Status = "completed",
ReleaseNotes = new List<LocalizedText>() { note }
}
}
},
packageName,
edit.Id,
track);
updatedTrack.Execute();
var appEdit = this.Service.Edits.Commit(packageName, edit.Id).Execute();
};
var result = uploadedApk.Upload();
}
The error is showed when updatedTrack.Execute();
is called.
I have no idea where I can fix this.
Is it a bug or is anyone know how to fix this ?
Thanks for your help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
"Track names in request path and request body must match ...
I am using google-api-python-client 1.7.11. I could not find anything about the error online. Has anyone here an idea? Update. Thanks to the ......
Read more >Android Publisher: "Track names in request path and ...
I'm having similar problems publishing with Codemagic Google Play publishing fails with "Track names in request path and request body must match", ...
Read more >Error messages | Resource Manager Documentation
The API server cannot parse the request body. The API request is missing required information. The required information could be a parameter or...
Read more >Resolve errors | Google Drive
Resolve a 5xx error This can be caused by various issues, including a request's timing overlapping with another request or a request for...
Read more >Scripted REST API example - script samples
A match on ALL of the terms in the phrase you typed. A match on ANY of the terms in the phrase you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After looking for a solution, I tried something and it worked!
I just added to the Track object (the “body”) the string value of TrackValue and it worked :
It could be nice to find an update notes when they update the API.
Anyway, the problem is solved, thanks all for your help.
You’re right, I updated my answer