Android Developers Blog
The latest Android and Google Play news for app and game developers.
πŸ”
Platform Android Studio Google Play Jetpack Kotlin Docs News

12 δΈ€ζœˆ 2023

Android Studio Electric Eel


Link copied to clipboard
Posted by Paris Hsu, Product Manager, Android Developer
Android Studio Electric Eel splash screen

Today, we are ⚡️electrified⚡️ to announce the latest stable release of the official IDE for building Android applications: Android Studio Electric Eel (2022.1.1)!

This release includes updates and new features that cover across design, build & dependencies, emulators & devices, and IntelliJ. Read or watch below to learn more about how they can help you more productively build apps, and download the latest stable version today to try it out for yourself!

Design

Compose Preview updates automatically - In earlier versions of Android Studio, you had to manually refresh Compose Previews after making changes. In Electric Eel, Previews update automatically after you make compatible code changes in the same file, allowing you to iterate on your UI faster. If your code change was incompatible, Previews will show a “Needs Rebuild” status to indicate needing a full build. When your code contains compilation errors during editing, Previews are temporarily paused, and then resumed again when the errors are fixed.
Moving image of a screenshot of Compose Preview updating automatically
Compose Preview updates automatically
Compose Preview device spec - Another update for Compose Preview is that you can now edit the device parameter of the Preview annotation to specify the configuration of the device. You can choose from reference devices or create your own, in which case autocomplete will help you with what options are available and what values they accept. This works together nicely with multipreview annotations, which are available since Dolphin.
Screenshot of Compose preview device spec
Compose Preview Device Spec
Layout Inspector recomposition rendering highlights: To make it easier to quickly see which of your composables are recomposing, Layout inspector now highlights recomposition. This allows you to identify where in the application the most recent activity caused the highest changes in recomposition counts. The UI elements with the most recent changes are temporarily overlaid with a color. This makes it easy to track down unexpected or excessive recompositions happening in your app. You can learn more about using the layout inspector to debug recomposition in Jetpack Compose: Debugging Recomposition.
Moving image of screenshot showing Layout Inspector recomposition rendering highlights
Layout Inspector recomposition rendering highlights
Visual Linting for Views: New for XML layouts, Visual linting now runs in the background to check for issues across different form factors, detecting problems such as overlapping or non-visible elements on a given device configuration.

For example, in the animated screen capture below, you can see that the layout file has two validation problems: a TextView covered by an ImageView on certain screen sizes and an ImageView, which is partially out-of-bounds in some configurations. Clicking on the problem in the Problems panel will open the Layout Validation panel to see your layouts rendered for the various device sizes and highlight the configurations with the selected issue.
Moving image of screenshot showing Visual Linting for Views
Visual Linting for Views
Universal Problems Panel: We have consolidated all the problems reported by various tools within Android Studio into the new Problems panel. This includes visual linting, navigation, and Compose related issues.

Screenshot showing the universal problems panel
Universal Problems Panel

Build & Dependencies

Improved Sync performance with parallel project imports: Parts of Gradle Sync now run in parallel by default; this can result in significant speedups for very large projects. Square has reported that their Gradle Enterprise metrics show an average reduction of 60% in sync times, saving an estimated 1,600 hours in developer productivity per year. Note: These improvements are specific to the time it takes Gradle to build models and don't change the performance of the IDE's processing of those models.

Download impact in Build Analyzer: The Build Analyzer tool provides you insight into what happens during your builds. This now includes a summary of any dependency downloads that happened. You can use this information to determine the impact of downloads on your build, and to spot problems such as downloads happening during incremental builds.

The information of the download impact is broken down by repositories, so you can see where each dependency was downloaded from. You can also see if a repository takes a long time to serve artifacts, or has a high number of failed requests. If that’s the case, you should consider removing the repository, if possible, or moving it lower in your repository configuration, so that other repositories take priority over it.
Moving image of Screenshot showing the build analyzer
Download impact in Build Analyzer
Upgrade Assistant post-upgrade report and rollback support: The Upgrade Assistant that helps you upgrade your project’s Android Gradle Plugin version also got more helpful in Electric Eel. After performing a version upgrade, the assistant will attempt to sync your project, and report whether it was successful. It now also gives you a summary of what steps were executed. Moreover, if the project sync fails after the upgrade, you can use the new Revert button to undo the changes to your build files.
Moving image of Screenshot showing Upgrade Assistant post-upgrade report and rollback support
Upgrade Assistant post-upgrade report and rollback support
SDK Index integration: We announced Google Play SDK Index earlier this year, which provides you information about various SDKs that you can integrate into your app. SDK developers can mark versions of their SDKs as outdated in the SDK index, and this information is now shown directly in Android Studio.

If you’re using a version marked as outdated, you’ll see a lint warning on the dependency in your build file to let you know that you should update it. Similarly, the Project Structure Dialog will show the same warnings on the outdated dependencies, and you can navigate to their Play SDK Index page from there to learn more.
Moving image of Screenshot showing SDK Index integration
SDK Index integration
Baseline Profile fix for App Bundles: Under certain circumstances Baseline Profiles could have been compressed when the app was built as an Android App Bundle. This resulted in the profile not being picked up when installing the app locally. In this local only scenario, benchmark results would be slower than anticipated. The bundletool version shipping with Electric Eel addresses and fixes this problem.

Inspect

All-new Logcat: Logcat has been rewritten from the ground up to make it easier to parse, query, and track logs. The new Logcat UI has been available to try as an opt-in feature in Dolphin, and it’s now enabled by default in Electric Eel, including a number of quality-of-life and stability fixes. Some highlights include better formatting for logs, a smarter search field with autocomplete support to filter for the logs you want to see, ability to persist log output across app restarts, and options to customize what’s displayed.
Moving image of Screenshot showing Logcat New UI
Logcat New UI
App Quality Insights window: The new App Quality Insights tools let you browse and investigate crash data from Firebase Crashlytics directly in Android Studio without having to jump back and forth between the IDE and a browser.

The IDE displays your top issues, which you can filter to show only the most recent crashes, or crashes from a specific version of your app. For each issue, you can see the number of affected users and the stack trace, which allows you to quickly navigate to the place in your code where the crash occurred. Moreover, you’ll see gutter icons in your source files, which indicate parts of your code that show up in your app’s top crash reports. Simply click on the link to navigate from the code to the crash report in the App Quality Insights window. To get started, read the official documentation.
Moving image of Screenshot showing App Quality Insights window
App Quality Insights window

Emulators & devices

New "Desktop" category & Desktop AVD: In Electric Eel, you now have the option to create a Desktop emulator. This lets you test how your app behaves on devices such as Chromebooks. There are a handful of interactions that are different on these devices that you should test with your app. For example, apps can be freeform resized or minimized, which your app should handle gracefully.
Moving image of Screenshot showing Testing apps on new Desktop AVDs
Testing apps on new Desktop AVDs
Resizable Emulator (Experimental): The Resizable emulator helps you test your app on different screen sizes without having to run multiple emulators. After creating and launching a resizable emulator, you can use the Display Mode menu to switch between different reference device sizes and see how your app behaves.
Moving image of using the Resizable Emulator
Using the Resizable Emulator
Physical Devices Mirroring (Experimental, Opt-in): You can now mirror your physical device to Android Studio and interact with it similarly to how you’d use an emulator. This is an opt-in feature in Electric Eel so that you can share feedback with us. In order to use it, you need to first go to Preference > Experimental > Device Mirroring to enable it. Then, connect your physical device through ADB (either through wired or wireless), and it will show up in the Running Devices panel. Once mirrored, you can interact with it much like you’re used to with emulators, such as multi-touch, physical buttons, and device rotation. Mouse and keyboard events are forwarded, and you can use the controls on the toolbar to input button presses, or to rotate the device.
You can also drag and drop files onto the mirrored device (just like on an emulator). If the file is an APK, it will be installed, which can be really useful for quickly testing a build. For other file types, the file will be copied to the device’s Download folder.
Moving image of physical devices mirroring in Android Studio
Moving image of physical devices mirroring on Physical Device
Physical Devices Mirroring (Android Studio and Physical Deice)

IntelliJ

IntelliJ Platform Update - Android Studio Electric Eel (2022.1.1) includes the IntelliJ 2022.1 platform release, which has many new features such as Dependency Analyzer to facilitate dependency management and conflict resolution and the Notifications tool window that offers a new, streamlined way to receive notifications from the IDE. It also includes a number of other notable improvements that are covered here.

To recap, Android Studio Electric Eel (2022.1.1) includes these new enhancements & features:

Design

  • Compose Preview updates automatically
  • Compose Preview device spec
  • Layout Inspector recomposition rendering highlights
  • Visual Linting
  • Universal Problems panel

Build & dependencies

  • Improved Sync performance with parallel project imports
  • Download impact in Build Analyzer
  • Upgrade Assistant post-upgrade report and rollback support
  • SDK Index integration
  • Baseline Profile fix for App Bundles

Emulators & devices

  • New "Desktop" category & Desktop AVD
  • Resizable Emulator (Experimental)
  • Physical Devices Mirroring (Experimental, Opt-in)

IntelliJ

  • IntelliJ Platform 2022.1 Update

Check out the Android Studio release notes, Android Gradle plugin release notes, and the Android Emulator release notes for more details.

Download Studio Today!

It is a good time to download Android Studio Electric Eel (2022.1.1) to incorporate the new features into your workflow. As always, we appreciate any feedback on things you like and issues or features you would like to see. If you find a bug or issue, please file an issue and also check out known-issues. Remember to also follow us on Twitter, Medium, or YouTube for more Android Development updates!