8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FlutterはデフォルトでReleaseビルドにInternetパーミッションを付けない

Posted at

はい、タイトルのとおりです。

昔は違ったのですが、今のFlutterでflutter createして作られるプロジェクトでは、android/app/src/main/AndroidManifest.xmlの中に<uses-permission android:name="android.permission.INTERNET"/>の指定がありません。そのため、リリースビルドしたアプリではインターネットに接続できず、Image.networkは何も読み込まないしHttpClientなどを使ったインターネット接続は全て失敗します。
android/app/src/debug/AndroidManifest.xmlの中には<uses-permission android:name="android.permission.INTERNET"/>が記述されているため、デバッグビルドであればインターネット接続ができます。

私はこのことに気付くまで1日かかりました……
リリースビルドしたときだけアプリが動かない!!

とお悩みの方は、一度これをチェックしてみてはいかがでしょうか。

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?