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
340
スタートアップ企業のフェーズ転換期を乗り越えるためのリアーキテクト戦略
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
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
200
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
12
10k
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
180
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
270
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
530
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
110
アクセシビリティから考える情報設計
high_g_engineer
0
380
新卒PdEのリアル
ryu1013
1
510
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
280
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
430
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
210
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
A Soul's Torment
seathinner
8
3.6k
The SEO identity crisis: Don't let AI make you average
varn
0
560
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Believing is Seeing
oripsolob
1
220
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
How GitHub (no longer) Works
holman
316
150k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
540
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
ぜひ日々のプロダクト開発や個人開発で 同じ轍を踏まないよう 参考にして頂けますと幸いです…
音声×テクノロジーでワクワクする社会をつくる