Share
Embed
I/O Extended 2022 in Android ~ Whats new in Android development tools
Google IO Extended 2022 Korea Android에서 발표한 "Whats new in Android development tools" 입니다
pluulove (노현석)
June 11, 2022
Transcript
63 slides
-
Whats new in Android development tools Android Studio Hyeonseok Noh
Android Developer Kakaobank -
2021.2.1 Stable Patch 1 Chipmunk 01 2021.3.1 Beta 2 Dolphin
02 2022.1.1 Canary 3 Electric Eel 03 Android Studio -
1. ѐߊ ২࣌ > ޖࢶ ٣ߡӦ ON 2. Android Studio
> run configurations ݫীࢲ “Pair Devices Using Wi-Fi”ࢶఖ -
Device Manager ADB over Wi-Fi Emulator tool window Instrumented Tests
Profileable Apps Layout Inspector Snapshots Interactive Preview Animated Vector Drawable Preview -
Jank Detection in CPU profiler 1. UI jank detection ~
Detect jank on Android 12 and higher : https://developer.android.com/studio/profile/jank- detection#detect_jank_on_android_12_and_higher 2. Spot your UI jank using CPU profiler in Android Studio : https://medium.com/androiddevelopers/spot-your-ui-jank-using-cpu- profiler-in-android-studio-9a4c41a54dab -
System Trace Recording record step : Start Profiler > CPU
> [ON] System Trace Recording > Record -
System Trace Recording record step : Start Profiler > CPU
> [ON] System Trace Recording > Record -
UI ߡߢѢܿ হ 01 জ ۨ दغӝ ী दझమ
ী ۨਸ ҅ࣘ ࠁմ ҃. ۨ ߡߢѢܻӝ ٸޙী ߊࢤ. 02 জ ۽ࣁझо ࢚ࠁ য়ې प೯. ۨ Deadline ӝળਸ ֈযࢾӝ ٸޙী ߡߢѢܿਵ۽ рػ ۨ. 03 Janky frames 1. Detect jank on Android 12 and higher : https://developer.android.com/studio/profile/jank- detection#detect_jank_on_android_12_and_higher 2. Spot your UI jank using CPU profiler in Android Studio : https://medium.com/androiddevelopers/spot-your-ui-jank-using- cpu-profiler-in-android-studio-9a4c41a54dab -
AndroidXܳ ਗೞח ۄ࠳۞ܻܳ ਤೠ ഐജࢿ ېӒ. ࠗ࠙ AndroidXܳ ਗ೮Ҋ ౸ױೞৈ
؊ ࢚ ۽ંী ࠛਃ. ېӒ۽ ੋ೧ ࠽٘ ࢿמ ೞؼ ࣻ . Chipmunk Jetifier warning # gradle.properties android.enableJetifier=true Jetifier warning and check in Build Analyzer : https://developer.android.com/studio/releases/gradle-plugin#jetifier-build- analyzer Deprecated -
Build Analyzer ~ Warning Jetifierܳ ઁѢܳ ঐदਵ۽ ֢. ઓࢿ(transitive
dependencies)ਸ ా೧ deprecatedػ ಁఃܳ ਃ۽ ೞח ۄ࠳۞ܻী ઓೠח Ѫਸ ঌ۰ષ. -
Build Analyzer ~ Warning Jetifierܳ ઁѢܳ ঐदਵ۽ ֢. ઓࢿਸ
ా೧ deprecatedػ ಁఃܳ ਃ۽ ೞח ۄ࠳۞ܻী ઓೠח Ѫਸ ঌ۰ષ. -
Build Analyzer ~ Fixed grade.properties enableJetifier ࣘࢿਸ False۽ ࣘࢿ
ઁѢद ૐ࠙ ࠽٘ ࣘبо 5~8% ࡈۄ https://developer.android.com/jetpack/androidx/migrate -
Run script on sunflower ganadist ~ https://gist.github.com/ganadist/b43d64510fbff2ff74f1aa92004fd3ff subprojects { afterEvaluate
{ configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> // minimum version of GMS Libraries which is migrated with AndroidX if (details.target.group.startsWith("com.android.support") || details.target.group.startsWith("android.arch")) { throw new GradleException("${details.target} library was included") } } } } } -
Run script ~ result * What went wrong: Execution failed
for task ':app:dataBindingMergeDependencyArtifactsDebug'. > Could not resolve all files for configuration ':app:debugCompileClasspath'. > Could not resolve com.android.support:support-v4:23.0.0. Required by: project :app > com.google.android.gms:play-services-basement:9.0.0 > com.android.support:support-v4:23.0.0 library was included com.google.firebase:firebase-auth:9.0.0 +--- com.google.android.gms:play-services-base:9.0.0 | +--- com.google.android.gms:play-services-basement:9.0.0 | | \--- com.android.support:support-v4:23.0.0 | +--- com.google.firebase:firebase-common:9.0.0 | \--- com.google.android.gms:play-services-tasks:9.0.0 +--- com.google.android.gms:play-services-basement:9.0.0 +--- com.google.firebase:firebase-auth-common:9.0.0 +--- com.google.firebase:firebase-auth-module:9.0.0 +--- com.google.firebase:firebase-common:9.0.0 \--- com.google.android.gms:play-services-tasks:9.0.0 ganadist ~ https://gist.github.com/ganadist/b43d64510fbff2ff74f1aa92004fd3ff -
Library has policy issues in SDK Index ۄ࠳۞ܻ ߡীח
Google Play झషযীࢲ ѱदܳ ରױೞח ଼ ग https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/ com/android/tools/lint/checks/GooglePlaySdkIndex.kt Electric Eel -
Library has policy issues in SDK Index ۄ࠳۞ܻ ߡীח
Google Play झషযীࢲ ѱदܳ ରױೞח ଼ ग Electric Eel https://play.google.com/sdks -
./gradlew --info --refresh-dependencies > Configure project : Evaluating root project
'sunflower' using build file '/Users/pluu/SampleProject/sunflower/build.gradle'. Downloading https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom to /Users/ pluu/.gradle/.tmp/gradle_download2958690770490799267bin Resource missing. [HTTP GET: https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.21/kotlin- gradle-plugin-1.6.21.pom] Resource missing. [HTTP GET: https://dl.google.com/dl/android/maven2/com/google/dagger/hilt-android-gradle-plugin/2.41/hilt- android-gradle-plugin-2.41.pom] … Downloading https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.21/kotlin-gradle- plugin-1.6.21.pom to /Users/pluu/.gradle/.tmp/gradle_download1710862990632809244bin Downloading https://repo.maven.apache.org/maven2/com/google/dagger/hilt-android-gradle-plugin/2.41/hilt-android-gradle- plugin-2.41.pom to /Users/pluu/.gradle/.tmp/gradle_download13128778667499341771bin … // root build.gradle buildscript { repositories { google() mavenCentral() } } -
п ݽٕ R ېझী ೠ ֎झಕझܳ ࢎਊೞب۾ ߸҃ AGPח ࠽٘
द ܻࣗझܳ জ R ېझী ࠂઁೞ ঋইب ػ, Non-Transitive R Classes 01 ٘ܳ ߸҃ೞ؊ۄب ೱਸ ߉ח ࢜۽ ݽٕ݅ द ҅ೠ. Lint Cache 02 More Builds Chipmunk -
android { testOptions { managedDevices { devices { pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice)
{ // Use device profiles you typically see in Android Studio. device = "Pixel 2" // Use only API levels 27 and higher. apiLevel = 30 // To include Google services, use "google". systemImageSource = "aosp" // Whether the image must be a 64 bit image. Defaults to false, // in which case the managed device will use a 32 bit image. // Not applicable to arm64 machines. require64Bit = false } } } } } Dolphin Gradle Managed Virtual Devices -
android { testOptions { managedDevices { devices { pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice)
{ // Use device profiles you typically see in Android Studio. device = "Pixel 2" // ATD currently support only API level 30. apiLevel = 30 // You can also specify "google-atd" if you require Google Play Services. systemImageSource = "aosp-atd" // Whether the image must be a 64 bit image. require64Bit = false } } } } } Dolphin Android testing ~ Gradle Managed Virtual Devices : https://developer.android.com/studio/preview/features#gmd AVD location : /Users/$USER/.android/avd/gradle-managed Automated Test Devices -
Profiler debuggable builds ٣ߡӦ ࠁ হ ۽ੌ݂ਸ द. ۽ੌ݂݅ਸ ਤೠ
పझо оמ - Enabled : CPU/Memory profilers TBD -
Dolphin https://developer.android.com/studio/preview/features#logcat New Logcat • New formatter/ࠂࣻ Logcat windows/Log View
ఋੑ ߸҃ • জ ج/द द द ۽Ӓ ୶о۽ ୶ -
Adobe Stock#243026154 Device Mirroring • File > Settings > Experimental
: Check Mirroring Electric Eel -
Visual linting নೠ ചݶ ӝীࢲ Visual Lint ޙઁ ഛੋ Layout
Validationਸ ৌݶ ݽٚ ۨইਓ ৈ۞ ӝ۽ ۪؊݂ ֢ Electric Eel -
Live Edit “Live edit of literals”ࠁ ѐࢶػ সؘ ܻ زਵ۽
ܻ ࠁӝܳ সؘ, ٘ ߸҃ ࢎ೦ਸ पदрਵ۽ ഛੋ оמ https://developer.android.com/jetpack/compose/tooling#live-edit Electric Eel -
Compose Preview Light/Dark Theme, ٣߄झ ߑೱ, ചݶ ӝ ١ নೠ
ઑѤীࢲ Composableਸ ܻ ഛੋೡ ࣻ . https://developer.android.com/jetpack/compose/tooling -
Preview sample @Preview(showBackground = true) @Preview(showBackground = true, uiMode =
Configuration.UI_MODE_NIGHT_YES) @Composable fun NiaCatalogPreview() { NiaTheme { Surface { // composable function } } } -
Multipreview sample @Preview(showBackground = true) @Preview(showBackground = true, uiMode =
Configuration.UI_MODE_NIGHT_YES) annotation class SamplePreview @SamplePreview @Composable fun NiaCatalogPreview() { NiaTheme { Surface { NiaCatalog() } } https://developer.android.com/jetpack/compose/tooling#preview-features Compose 1.2 -
Compose Animation ݽٚ গפݫ࣌ਸ ೠ ߣী ѨࢎೞҊ ઑ оמ. ౠ
গפݫ࣌ਸ Ҋب оמ Electric Eel -
Compose Recomposition Counts Layout Inspectorܳ ࢎਊೞৈ ۨইਓ ҅க п
Composable ҳࢿغѢա Ѥցګ दਸ ഛੋ оמ. https://github.com/ComposeDesigner/ComposeLoginScreen https://developer.android.com/studio/preview/features#new_in_compose Compose 1.2-alpha03 -
Android Studioী োѾػ Google ҅ Firebase Crashlytics۽ ఐػ ী۞ܳ ഛੋೡ
ࣻ • Crashо ߊࢤೠ Devices • Android Versions • App version, ࣻ दр App Insights Electric Eel -
Electric Eel Android Studioী োѾػ Google ҅ Firebase Crashlytics۽ ఐػ
ী۞ܳ ഛੋೡ ࣻ • Crashо ߊࢤೠ Devices • Android Versions • App version, ࣻ दр App Insights -
gradle.properties # Automatically convert third- party libraries to use AndroidX
android.enableJetifier=false ۽ં 80%о ࢎਊ 80% ઁѢद ૐ࠙ ࠽٘ ࣘبо 10% ࢚ ೱ࢚ ~10% -
Dolphin Electric Eel Logcat v2 SDK Index Integration WearOS Launch
Configurations WearOS Pairing Assistant & Toolbar Gradle Managed Devices Compose Recomposition in Layout Inspector Compose Animation Coordination Preview Live Edit (Jetpack Compose) Visual Lint for Compose Compose Multi-Preview Device Mirroring Resizable Emulator App Quality Insights android studio -
Thank you! Hyeonseok Noh @pluulove Android Developer Kakaobank https://developer.android.com/studio/releases https://developer.android.com/studio/preview/features
https://developer.android.com/studio/releases/gradle-plugin Resources