Hyperion-Androidを使ってみた
社内でHyperion-Androidがデバッグに便利、という情報を得たので試しに使ってみた。
環境
Android Studio 3.2 Beta 5 Build #AI-181.5281.24.32.4913314, built on July 26, 2018 JRE: 1.8.0_152-release-1136-b04 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.12.6
Hyperion-Androidとは
説明は書くのが面倒なので省く、以下記事をみると分かりやすい - Hyperion-AndroidでAndroidアプリをデバッグしよう - Qiita https://qiita.com/takahirom/items/2f6557f945ddd7c5e074
インストール
リポジトリを探してREADMEを眺める
willowtreeapps/Hyperion-Android: App Debugging & Inspection Tool for Android https://github.com/willowtreeapps/Hyperion-Android
usageに載ってるが、コア機能とプラグインをapp/build.gradleに突っ込めば使えるそうだ
implementation 'androidx.appcompat:appcompat:1.0.0-beta01' implementation 'androidx.constraintlayout:constraintlayout:1.1.2' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-core:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-attr:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-measurement:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-disk:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-recorder:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-phoenix:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-crash:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-shared-preferences:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-geiger-counter:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-timber:0.9.24' + debugImplementation 'com.willowtreeapps.hyperion:hyperion-build-config:0.9.24' + testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
ビルド=>エラー
Sync => OK
Run Buld => エラーになった!!!??
エラーメッセージは
Program type already present: android.support.v4.os.ResultReceiver
既にResultReceiver
が存在? 何を言っとるんだねキミは...
ググるとAndroidX関連のエラーらしい
そういえば試しにAndroidX導入したんだった。
解決方法
gradle.propertiesに以下を追加するだけ
# This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +android.enableJetifier=true +android.useAndroidX=true
ビルド再チャレンジ
Sync => OK
Run Buld => OK
よーし、できた
本体を振るとHyperion-Androidメニューが表示された
Hello Hyperion-Android pic.twitter.com/2lPF4lzI6X
— イケムラ (@ikemura_jp) 2018年8月1日
備考
今回使用したコードのリポジトリは以下
https://github.com/banbara23/Android-Kotlin-Lab/tree/Hyperion-Android