Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
解決むずかったバグ3選
Search
horitamon
April 12, 2022
Programming
520
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
解決むずかったバグ3選
horitamon
April 12, 2022
More Decks by horitamon
See All by horitamon
Kotlin Multiplatformで考えるクリーンアーキテクチャ
horitamon
0
330
スタートアップ企業のフェーズ転換期を乗り越えるためのリアーキテクト戦略
horitamon
0
610
ActでGithub Actionsの動作確認をする
horitamon
0
1.5k
Bitrise Pipelinesを使って リリース作業を効率化する
horitamon
0
74
コルーチンを使って処理の見通しをよくする
horitamon
2
2.4k
「OK Google」でアプリの機能を呼び出してみる
horitamon
0
1.7k
Other Decks in Programming
See All in Programming
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
330
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
Family mrubyの進捗
kishima
1
120
XHTMLが残したもの
yosuke_furukawa
PRO
2
800
Intent as Code
shoppingjaws
6
1k
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
1k
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.2k
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
4
2.6k
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
390
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
680
スマート反転とウェブアクセシビリティ
camiha
0
210
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
520
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
Producing Creativity
orderedlist
PRO
348
41k
New Earth Scene 8
popppiees
4
2.6k
Designing for humans not robots
tammielis
254
26k
How to Ace a Technical Interview
jacobian
281
24k
KATA
mclloyd
PRO
35
15k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
解決むずかったバグ3選 2022/04/12 Android個人開発LT @horitamon
• モバイルアプリエンジニア (Androidがメイン) • 2021/09 Voicy入社 • 今年スノボにハマって 18回ゲレンデへ •
なぜか小学校の教員免許持ってる 自己紹介 horitamon(堀 多聞)
©2022 Voicy, Inc. はじめに • Bluetooth LE使ってデータやりとりできるアプリをつくってます • 全然進んでないので今日は話しません()
• アプリ開発をしていて「ちゃんと事前に検証しておけばよかった…」と 反省したバグを赤裸々にご紹介 • ご迷惑をかけたユーザーのみなさま、大変申し訳ありませんでした。 今回の発表内容
バグ① RecyclerViewの読み込みがめっちゃ重い
Android iOS
原因: RecyclerViewの高さを可変にしていることで描画処 理が毎回走る
©2022 Voicy, Inc. 原因 • RecyclerViewは同じようなレイアウトをたくさん表示するときに 描画を効率化してくれる →画面に表示されていない範囲は描画しない • 「もっと見る」を押してRecyclerViewの要素を追加すると
RecyclerViewの表示範囲が広がるように実装していた →全要素の描画処理が一気に走ってしまう
端末の表示範囲 NestedScrollView RecyclerView 端末の表示範囲 NestedScrollView RecyclerView
端末の表示範囲 NestedScrollView RecyclerView 端末の表示範囲 NestedScrollView RecyclerView 全部描画!
©2022 Voicy, Inc. 対策 • ベストは併用しないこと • 併用するとしたらRecyclerViewの高さを固定にする →表示範囲外のitemはスクロールした後に描画処理が走る
端末の表示範囲 NestedScrollView RecyclerView 端末の表示範囲 NestedScrollView RecyclerView 暫定的に固定して スクロールできるように
バグ② たまにしかPush通知が届かない
©2022 Voicy, Inc. 現象 • Firebase Cloud Messagingを使ってPush通知を実装している • 動作確認のタイミングでは大体通知が届く
• 放送開始、運営からのお知らせなど、種別問わずすべての通知が届く • 開発版でも製品版でも届く • でもしばらく使ってると届かなくなる… Push通知が来ることには来る、でも来なくなる
原因: トークン更新処理が完了する前に トークンを再発行していた
None
None
https://firebase.google.com/docs/reference/android/com/google/firebase /messaging/FirebaseMessaging?authuser=0#public-methods
https://firebase.google.com/docs/reference/android/com/google/firebase /messaging/FirebaseMessaging?authuser=0#public-methods
https://firebase.google.com/docs/reference/android/com/google/firebase /messaging/FirebaseMessaging?authuser=0#public-methods 非同期
©2022 Voicy, Inc. 原因と対策 • firebase-bomを26.2.0→28.2.0にアップデートした →そのタイミングでFirebaseMessaging.deleteToken()が 非同期メソッドに変わった •
トークンの削除が完了する前に発行処理をしていたので 発行後にトークンが更新されていた • 完了を待機してから再発行するように修正
削除完了を 待機
バグ③ Android 8の端末だけアプリ起動できない
©2022 Voicy, Inc. 現象 • シンプルにAndroid 8だけ起動しない • 8より古いOSも、新しいOSも起動する
Android 8だけアプリが起動しない
©2022 Voicy, Inc. 原因と対策 • 以下の条件を満たすとクラッシュする ◦ Android 8.0
の端末 ◦ targetSdkVersion が 27 以上 ◦ 背景を透過にしている ◦ 画面の向きを固定している • アプリ全てで使ってるStyleで android:windowIsTranslucentをtrueにしてしまった →すぐ設定を削除
©2022 Voicy, Inc. 原因と対策 • 下記の記事に救われました…ありがとう… ◦ java.lang.IllegalStateException: Only
fullscreen opaque activities can request orientation - Qiita
ぜひ日々のプロダクト開発や個人開発で 同じ轍を踏まないよう 参考にして頂けますと幸いです…
音声×テクノロジーでワクワクする社会をつくる