I was trying to upload apk to firebase app distribution via dart code using GoogleApis
final binaryFile = File(binaryPath);
final binaryFileLength = binaryFile.lengthSync();
FirebaseAppDistributionApi(client).media.upload(
GoogleFirebaseAppdistroV1UploadReleaseRequest(),
appName,
uploadMedia: Media(
http.ByteStream.fromBytes(binaryFile.readAsBytesSync()),
binaryFileLength,
),
);
It gives me 400 status code without proper error message like this
DetailedApiRequestError(status: 400, message: No error details. HTTP status was: 400.)
The appName
and credentials I used to authenticate client
are right, because the following code was working fine and gave me the output from the firebase.
FirebaseAppDistributionApi(client)
.projects
.apps
.releases
.list(appName);
The binary I was trying to upload also seems fine, because I tried to upload it to the app distribution console manually and it was uploaded successfully.
How can I properly upload the apk to firebase via dart? Is there anything else I should setup? Any help would be highly appreciated.