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
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
解決むずかったバグ3選
horitamon
April 12, 2022
Transcript
27 slides
解決むずかったバグ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
ぜひ日々のプロダクト開発や個人開発で 同じ轍を踏まないよう 参考にして頂けますと幸いです…
音声×テクノロジーでワクワクする社会をつくる
More Decks by horitamon
See All by horitamon
Kotlin Multiplatformで考えるクリーンアーキテクチャ
horitamon
0
380
スタートアップ企業のフェーズ転換期を乗り越えるためのリアーキテクト戦略
horitamon
0
630
ActでGithub Actionsの動作確認をする
horitamon
0
1.5k
Bitrise Pipelinesを使って リリース作業を効率化する
horitamon
0
80
コルーチンを使って処理の見通しをよくする
horitamon
2
2.4k
「OK Google」でアプリの機能を呼び出してみる
horitamon
0
1.7k
Other Decks in Programming
See All in Programming
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.8k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
230
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.5k
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
630
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
5.6k
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
560
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
230
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
750
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
250
protojson における文字化けの扱い
kazuki1023
0
400
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
370
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
A designer walks into a library…
pauljervisheath
211
25k
Mind Mapping
helmedeiros
1
440
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
SEO for Brand Visibility & Recognition
aleyda
0
4.9k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
470
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
370
Rails Girls Zürich Keynote
gr2m
96
14k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280