タグ: android

  • Flutter –dart-define が空文字になる

    Flutter 3.29.3 にて。

    String accessToken = String.fromEnvironment("MAPBOX_ACCESS_TOKEN");

    ではダメで、const が必要。

    String accessToken = const String.fromEnvironment("MAPBOX_ACCESS_TOKEN");

    参考: https://stackoverflow.com/a/76718173

    追記: 公式ドキュメントにも書いてありました。

    https://api.flutter.dev/flutter/dart-core/String/String.fromEnvironment.html

    This constructor is only guaranteed to work when invoked as const. It may work as a non-constant invocation on some platforms which have access to compiler options at run-time, but most ahead-of-time compiled platforms will not have this information.

  • Android Flutter メモ

    adb.exe の場所

    C:\Users\[user]\AppData\Local\Android\sdk\platform-tools\

    WiFi Debug 方法: 「ペア設定コードによるデバイスのペア設定」を押して

    adb pair <host:port> <paring code>

    その後, (このポート番号は「IPアドレスとポート」のところに表示されてるやつ)

    adb connect <host:port>

    ビルドの転送のため、ネットワーク速度は開発体験的に重要そう。