[Bug]: Android Capacitor Returns UTF-8 Binary String Instead of Blob for Binary Responses

オープン
#7,944 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
android, typescript
領域
mobile-dev

調査の方向性

リンクされたプロジェクトの再現から始め、responseType: 'blob' を使用するリクエストの Android での処理を追跡します。Android の結果を、issue で説明されている Web の Blob の動作と比較します。Android と Web の両方で、バイナリレスポンスが一貫して標準の Blob を返すようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

plugin: http type: bug
Capacitor Version

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android:
7.1.0
@capacitor/ios: 7.1.0

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0

[success] Android looking great! 👌

Other API Details
npm -v 10.9.2

 node -v v23.9.0
Platforms Affected
  • iOS
  • Android
  • Web
Current Behavior

When making network requests with responseType: 'blob' on Android with Capacitor, instead of receiving a proper Blob object like on web platforms, the response is a UTF-8 encoded binary string. This inconsistency causes issues when trying to handle binary data like audio files across different platforms.

  • On web: response.data is a proper Blob object

Image

  • On Android: response.data is a UTF-8 encoded binary string

Image

Expected Behavior

When making a request with responseType: 'blob', the response should be a standard Blob object on all platforms (web and Android), allowing consistent code handling.

Project Reproduction

https://gist.github.com/layola13/55bd89421c9e82d066d584b80f0da551

Additional Information

This inconsistency makes it difficult to handle binary responses in a cross-platform manner. Ideally, Capacitor should normalize the response type to be consistent with web behavior, returning a proper Blob object when responseType: 'blob' is specified.

主要言語
TypeScript
スター
17.1k
フォーク
1.3k
平均マージ
1日 22時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/capacitor のほかの issue

ionic-team/capacitor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。