最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flutter - Error 400 when trying to upload apk to firebase app distribution via GoogleApis -> FirebaseAppDistributionApi -

programmeradmin0浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论