flutter run
したときに Resolving dependencies...
から進まなくなった
Error retrieving device properties for ro.product.cpu.abi:
error: insufficient permissions for device.
Launching lib/main.dart on <myDevice> in debug mode...
Initializing gradle...
Resolving dependencies...
一回目のビルド・実行時には見られなかったが、
二回目以降でビルドが通らなくなった
対象読者
$ flutter analyze -v
を実行して
error • The function 'test' isn't defined • workspace/dart/flutter/packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart:124:5
とかとかエラーがたくさん吐かれる方々
結論
公式を参考に dart2_fix
を突っ込みましょう
dart2_fixって何者?
A tool to migrate API usage to Dart 2
dart1.*系のコードをdart2.0.0(2018/08/20時点)にリファクタリングしてくれるツールだそうです
build:failedだけど大丈夫か
# Flutterアプリのrootディレクトリに移動
$ cd /path/to/flutter-project/root
# flutter パッケージの更新
$ flutter packages upgrade
ここを参考に
# dart2_fixをインストール
$ flutter packages pub global activate dart2_fix
# dart2_fixを実行後、自動的にFIX
$ flutter packages pub global activate dart2_fix
この状態で flutter analyze
を実行すると
$ flutter analyze
Analyzing <project-name>...
No issues found! (ran in 1.5s)
となれば成功
flutter run
してみる
Launching lib/main.dart on <myDevice> in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...
I/FlutterActivityDelegate(21630): onResume setting current activity to this
I/vndksupport(21630): sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8996.so from the current namespace instead.
Syncing files to device <myDevice>...
無事、ビルド・実行できました
公式から配布されているものを安易に信用してはいけないことの何よりの証左でしたとさ