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
AndroidXに移行するために
Search
syarihu
July 26, 2018
Technology
18k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AndroidXに移行するために
potatotips #53で発表した資料です。
syarihu
July 26, 2018
More Decks by syarihu
See All by syarihu
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
1k
Recap #io25 What's new in Google Play
syarihu
0
160
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
4
5.4k
[shibuya.apk #46] Composableの枠を超えてアニメーションする / Animation beyond Composable
syarihu
0
180
[shibuya.apk #41] Jetpack Composeでグリッドに柔軟にスペースを入れたい
syarihu
0
3.7k
[DroidKaigi 2022] 詳解Google Playの新しい定期購入 ~オファーの活用や実装例を添えて~
syarihu
0
4k
5分で分かるGoogle Playの新しいサブスクリプション / Google Play new subscription 2022
syarihu
1
2k
[DroidKaigi 2021] Google Play 定期購入 比例配分モード完全攻略ガイド / Google Play Subscription Proration Mode Complete Guide
syarihu
1
8.2k
[Money Forward Tech Drive] What's new in Google Play [Recap #io21]
syarihu
0
680
Other Decks in Technology
See All in Technology
Obsidian Vault Architectures
x5gtrn
PRO
0
210
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
230
Flutter Webを「SDK」として配る — 50以上のゲームを支える埋め込みアーキテクチャ
masayukisuda
0
160
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
7
4.8k
AIで選択肢が広がった組織設計の理想と現実
konifar
16
6.9k
Draft AIエージェントの トークン消費を最小化する 8つの原則
kinopeee
6
1.9k
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
440
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
5
2.3k
AI AgentによるEmbedded SREの取り組み
tgidgd
1
210
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
400
AI駆動開発における開発環境のセキュリティの考え方
yamahiro
2
680
シンプルな設定ファイルで実現する AWS IAM Identity Center の ユーザー管理Terraformフレームワークを公開しました / Simplifying AWS IAM Identity Center User Management: An Open-Source Terraform Framework
yamaguchitk333
1
340
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Mind Mapping
helmedeiros
1
420
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
640
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
460
The Curious Case for Waylosing
cassininazir
1
590
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Deep Space Network (abreviated)
tonyrice
0
390
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
380
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
470
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
820
Transcript
AndroidXに移行するために 2018/07/26 (Thu) potatotips #53 @syarihu
Taichi Sato (@syarihu) • Money Forward, Inc. ◦ Android Engineer
• TechBooster
Support Library
Support Library • Android Framework の API に下位互換性 を保つために 7
年以上前から開発されて いる • さまざまな機能が含まれている ◦ 端末固有の UX ◦ デバッグ ◦ テスト ◦ その他ユーティリティ
Support Library • 現在ほとんどの Android アプリで Support Library が導入されている •
長年のアップデートによるライブラリの成 長が開発者に混乱をもたらしている ◦ サポートされているのは v14 以降だけ ど、パッケージ名は v7 など
AndroidX
AndroidXとは • Android の新しい拡張機能ライブラリ • Support Library は v28 で終了し、今後は
AndroidX に移行する必要がある • AndroidX のバージョンは v1.0.0 から 新たに始まる ◦ 2018 年 7 月現在の最新は beta01 • パッケージ名も androidx になる
android.*とandroidx.* • android.* ◦ プラットフォームにバンドルされている API • androidx.* ◦ すべての
Android バージョンで可能な 限り一貫して動作する機能を提供する
AndroidXへの移行
AndroidXへの移行 • AndroidX への移行には移行ツールが 用意されている • 試しに Money Forward の
Android アプリ を AndroidX に移行してみる
build.gradle buildscript { dependencies { classpath "com.android.tools.build:gradle:3.3.0-alpha03"
app/build.gradle android { compileSdkVersion 28 buildToolsVersion "28.0.0"
いざビルド!
None
None
None
shortcuts.xml • App Shortcuts のための設定ファイル • Build Variants によってパッケージ名を分けてお り、
shortcuts.xml 内に記述するパッケージ名をビ ルド後のファイルを replace することで動的に切り替 えられるようにしていた
aapt2 • Android Asset Packaging Tool 2.0 • リソース処理の改善 •
Android Gradle Plugin 3.0.0 からデフォルトで有効 ◦ android.enableAapt2=false で無効にできた • Android Gradle Plugin のアップデートにより enableAapt2 のプロパティが削除された
aapt2 • リソースの出力が生の xml ファイルではなく、圧縮 された flat ファイルが生成される • そのため、
shortcuts.xml を動的に変更することが できなくなった • パッケージごとに手動で shortcuts.xml を 作らないとダメそう …
とりあえず動的変更部分を 修正することで回避…
Migrate to AndroidX
Migrate to AndroidX • Android Studio 3.2 Canary 14 以降で利用できる
Android X への移行ツール • 今回は Android Studio 3.3 Canary 3 を使用
Refactor -> Migrate to AndroidX…
None
None
いざビルド!
* What went wrong: A problem occurred configuring project ':app'.
> Could not resolve all files for configuration':app:xxxxxxxxxxCompileClasspath'. > Failed to transform file 'xxxxxxxxxx.aar' to match attributes {artifactType=processed-aar}using transform JetifyTransform > Failed to transform
android.useAndroidX=true android.enableJetifier=true gradle.properties
enableJetifier • AAR/JAR のマイグレーションツール • ライブラリ内部で使用されている Support Library などを AndroidX
に置き換えてく れる • エラー出たライブラリ内部で利用されている Support Library がうまく置き換え出来なかったぽ い
とりあえずエラー出たライブラリを 使わないようにして回避…
もう一回ビルド!
/app/build/generated/source/kapt/xxxxx/xxxxx/DeepLinkDelegate.java:8: エラー : シンボルを見つけられません import android.support.v4.app.TaskStackBuilder; ^ シンボル : クラス
TaskStackBuilder 場所 : パッケージ android.support.v4.app
DeepLinkDispatch • このライブラリが自動生成する java ファイルが Support Library のクラスを出力してしまっていたた めにエラーが発生していた
https://github.com/airbnb/DeepLinkDispatch/issues/222
https://github.com/airbnb/DeepLinkDispatch/pull/223
PRは上がってたけどCI周りの問題が あるっぽく、6月から何も動いてなかった…
\(^o^)/
AndroidX移行差分 • 今回ビルドは通せませんでしたが、参考程度に …
まとめ • Android X への移行には Android Studio の移行 ツールを使う •
compileSdkVersion 28 以上必須なので、 27 以下のアプリはその対応も必要 ◦ 特に 25 -> 26 へ上げるのが大変なので早めに やっておいたほうがよい ◦ どちらにせよ今後のアップデートでは必須
まとめ • 移行ツールを使っても、手直しはだいたい 必要になる
まとめ • 特に OSS をたくさん利用している プロジェクトは注意! ◦ 今回紹介した以外にも問題はたくさん出てくる と予想できる ◦
利用している OSS が AndroidX 対応していない 場合はコントリビュートの機運 … ?
まとめ • 正式リリースはまだだが、 Beta が出ているためそろそろ準備をしておいたほ うがよさそう ◦ 少なくとも、とりあえず試しにやってみて、どれく らい工数がかかりそうかは見ておいたほうがよさ そう
コントリビュートもできるらしい • AOSP AndroidX Contribution Guide ◦ https://android.googlesource.com/platform/framewo rks/support/+/androidx-master-dev/README.md https://twitter.com/yuichi_araki/status/1021607877801168896?s=21
参考資料 • Google Developers Japan: AndroidX の紹介 https://developers-jp.googleblog.com/2018/05/hello-world-androidx.h tml
ありがとうございました