Tag Archives: Gradle sync

Android Studio Hedgehog is stable

Posted by Sandhya Mohan, Product Manager

Today, we are thrilled to announce the stable release of Android Studio Hedgehog 🦔 : The official IDE for building Android apps!

In this Android Studio release, we have upgraded the IntelliJ platform to 2023.1, with features designed to improve app performance and battery life, make it easier to upgrade applications to the latest Android version, and make it faster to develop using Jetpack Compose. Read on to learn more about how Android Studio Hedgehog can help supercharge your developer productivity.

App performance

Android vitals in App Quality Insights

In addition to helping you investigate crash reports for apps instrumented with the Firebase Crashlytics SDK, App Quality Insights now also includes Android vitals data from Google Play Console. With Android vitals, you can see crash reports for any app you publish to the Google Play Store without requiring additional instrumentation in your app. You can view Android vitals issues, filter them, and see crash insights from Play to quickly understand and resolve the cause of a crash, and jump from stack trace to code all from the App Quality Insights tool window. Learn more.

Note: If you don't have permission to view your app in the Play Console, request that the app admin share read-only access to only app quality information, by clicking Users and permissions > View app quality information (read-only) in the Play Console.

Screengrab of Android Vitals data in App Quality Insights
Android Vitals data in App Quality Insights

Power Profiler

The new Power Profiler shows power consumption on devices. It segments the power consumption information by subsystems called "Power Rails". This helps you visualize the correlation between power consumed and the actions occurring in your app. This approach of directly measuring power consumption differs from the legacy Energy Profiler, which only used a model to estimate energy consumption.

By understanding this information, you can potentially identify and fix power consumption issues in your app by running A/B tests to compare the power consumption of different algorithms, features or even different versions of your app.

Apps which are optimized for lower power consumption lead to an improved battery and thermal performance, eventually leading to an improved end user experience. Power Rails data is available on Pixel 6+ devices running Android 10+.

Example of power consumption in different power rails.
Example of power consumption in different power rails.

Coding productivity

Target Android 14 using Android SDK Upgrade Assistant

The SDK Upgrade Assistant provides a step by step wizard flow to help developers through targetSdkVersion upgrades. It pulls documentation directly into the IDE, saving you time and effort.

Android Studio Hedgehog adds support for upgrading projects to Android 14 (API Level 34). We’ve also added additional relevance filters so that unnecessary steps are removed — and in some cases, the upgrade assistant will pinpoint exactly where in code the changes need to be made.

Screengrab of Android SDK Upgrade Assistant
Android SDK Upgrade Assistant

New UI updates

In the Giraffe release, we launched a new UI for the IDE. This reimagined theme reduces visual complexity and provides easier access to essential features, resulting in a more modern and clean look and feel. We’ve listened to your feedback and, in Hedgehog, we’ve added updates for compact mode, vertical and horizontal splitting, and project tabs for Mac OS. If you have not yet tried the new UI, we encourage you to do so.

Screengrab of Compact mode in the New UI
Compact mode in the New UI

Device mirroring

You can now mirror your physical Android device in the Running Devices window in Android Studio. While mirroring your device's display directly via ADB over USB or Wi-FI to Android Studio, you can execute common actions such as starting and interacting with apps, rotating the screen, folding and unfolding the phone, changing the volume, and more – directly from within Android Studio. Learn more.

Moving image demonstrating device mirroring in the running devices window
Device Mirroring in the Running Devices window

Embedded Layout Inspector

You now have the option to run the Layout Inspector directly in the Running Devices tool window while running your app on an embedded virtual device or mirrored physical device. This opt-in feature significantly improves performance of Layout Inspector, conserves screen real estate, helps organize your UI debugging workflow in a single tool window, and improves speed while inspecting your layout. In embedded mode, you can show a view hierarchy, inspect the properties of each view, navigate to code using “deep inspect” mode, and access other common Layout Inspector features. Enable it through Settings > Experimental > Layout Inspector

Screengrab showing Embedded Layout Inspector
Embedded Layout Inspector

Live Edit updated manual mode shortcut

Live Edit has a new default shortcut for manual mode for: Control+\ (Command+\ for macOS). Manual mode is helpful in situations where you want to have precise control over when updates are deployed to the running application. For more information, see the video clip in Live Edit for Jetpack Compose.

Compose tools

Compose Preview’s Gallery Mode

Gallery mode is a new mode in Compose Preview that lets you focus on one Preview at a time to conserve rendering resources. Use Gallery mode when iterating on UI and switch to other modes (Grid or List) when you need to see UI variants.

Moving image of Compose Preview's Gallery Mode
Compose Preview’s Gallery Mode

Compose State information in Debugger

When setting a breakpoint on a Composable function, the debugger now lists the parameters of the composable and their state, so you can more easily identify what changes might have caused unexpected recompositions.

Screengrab of Compose State information in Debugger
Compose State information in Debugger

Compose Multipreview templates

Android Studio Hedgehog includes support for the latest annotations added by the Compose Multipreview API, allowing developers to render common layout scenarios side-by-side while working with the Compose Preview.

The new annotations added include: @PreviewScreenSizes, @PreviewFontScales, @PreviewLightDark, and @PreviewDynamicColors

Screengrab of Compose Multipreview templates
Compose Multipreview templates

Build tools

New macro to specify JDK path

A new macro, #GRADLE_LOCAL_JAVA_HOME, makes it safer and easier to specify the Java* home path used for the Gradle daemon (background process) execution for your project by referencing your .gradle/config.properties file. This reduces errors related to incompatible Gradle and project JDK versions, since there is now a single source of truth for your Gradle JDK selection.

Starting with Android Studio Hedgehog, new projects will use #GRADLE_LOCAL_JAVA_HOME by default. Existing projects will automatically be migrated to the new macro after a successful sync, unless you're already using a macro like #JAVA_HOME.

[Windows-only] Minimize the impact of antivirus software on build speed

The Build Analyzer informs users if antivirus software may be impacting build performance. This can occur if antivirus software, such as Windows Defender, is performing real-time scanning of directories used by Gradle. Build Analyzer recommends a list of directories to exclude from active scanning, and, if possible, provides a link to add them to the Windows Defender folder exclusion list.

Use Firebase Test Lab devices with Gradle Managed Devices

Gradle Managed Devices can now target Firebase Test Lab devices, and you can utilize it to run your automated tests at scale. Use Gradle Managed Devices to select from a wide range range of both physical and virtual FTL devices, with support for test sharding for accelerated execution time. To use FTL devices, you need Android Gradle Plugin 8.2 with the latest Alpha version of the Firebase Test Lab Gradle plugin. Learn more.

Download Android Studio today!

Now is the time to download Android Studio Hedgehog to incorporate the new features into your workflow. As always, we appreciate any feedback on things you like, issues, or features you would like to see. If you find an issue, please check the known issues and file a bug if needed. Remember to also follow us on X (formerly known as Twitter), Medium, or YouTube for more Android development updates!


*Java is a trademark or registered trademark of Oracle and/or its affiliates.

Android Studio Giraffe is stable

Posted by Mayank Jain, Product Manager

Today, we are thrilled to announce the stable release of Android Studio Giraffe 🦒 : The official IDE for building Android apps!

In this Android Studio release, we have upgraded the IntelliJ platform to 2022.3, including a brand new visual look and feel in Android Studio, improvements to Live Edit, Compose animation previews, a new Device Explorer, a new SDK upgrade assistant, ability to use Kotlin DSL in your Gradle build scripts and much more. Read on to learn more about how Android Studio Giraffe 🦒 can help supercharge your developer productivity.

Thank you to all of you who have given us feedback and used Android Studio since we launched our initial version just over 10 years ago. Download the latest stable version today and we look forward to continuing to deliver on our commitment of delivering a best-in-class integrated development environment (IDE) focused on Android app development!

IDE Enhancements

New UI for Android Studio (Preview) 
Along with the much anticipated IntelliJ Platform update, we are excited to share a preview of the visual look that we call the “New UI” for Android Studio Giraffe. The redesigned theme aims to reduce visual complexity, provide easier access to essential features, and disclose complex functionality as needed—resulting in a modern, cleaner look and feel.

The New UI was first released as an early preview in IntelliJ 2022.2 to gather feedback from users and other IntelliJ-based IDEs to ensure it could fully replace the previous UI. Since then, it’s progressed to beta in IntelliJ 2022.3, with many bug fixes and improvements.

With the Giraffe release, we’ve started adopting the new UI, with several Android Studio specific changes, such as optimizing the default main toolbar and tool windows configurations for Android and refreshing our iconography in the style. We are excited by this new design direction and will continue adoption through the Hedgehog release and onward.

To use the New UI, enable it in Settings > Appearance & Behavior > New UI. For a full list of changes, see the IntelliJ New UI documentation.

Image showing the new UI adopted from IntelliJ
The New UI adopted from IntelliJ
New diagnostic & bug reporting tool 
As you try the New UI, please provide us detailed feedback through our new diagnostic & bug reporting tool that makes it easier to report bugs with relevant log files already attached. The new bug reporting tool is found at Help > Collect Logs and Diagnostic Data.

Image showing the new diagnostic & bug reporting tool
New diagnostic & bug reporting tool
Updated Device Explorer 
Also shipping with the new UI, is an updated Device Explorer (known as the Device File Explorer in previous versions of Android Studio). In the Device Explorer, files and related actions are located in the Files tab. Additionally, in the new Processes tab, you can view a list of debuggable processes for the connected device. From there you can also select a process and perform a kill , force-stop, or attach the debugger to a given process.

Image showing a screen capture of the updated device explorer
Updated Device Explorer

Coding Productivity

Use Live Edit to update composables in real time 
Live Edit lets you update composables in Android emulators and physical devices in near real time. You can now edit composables and see the UI changes on the running device without re-deploying your app.

This helps you by minimizing the context switching between writing and building your app, letting you focus on writing code longer without interruption. To try Live Edit, enable it via Settings > Editor > Live Edit and use Android Gradle Plugin (AGP) 8.1 or higher and Jetpack Compose Runtime 1.3.0 or higher.

Moving image illustrating updating composables in real time in Live Edit
Use Live Edit to update composables in real time
 
Compose Animation Preview - Extend animation support  Compose Animation Preview now supports a number of additional Compose APIs, such as animate*AsState, CrossFade, rememberInfiniteTransition, and AnimatedContent (in addition to updateTransition and AnimatedVisibility). Additionally, now there are new pickers that let you set non-enum or boolean states to debug your Compose animation using precise inputs. For all supported Compose Animation APIs, you can play, pause, scrub & control speed.

Moving image illustrating extended animation support in Compose Animation Preview
Compose Animation Preview - Extend animation support
 
Android SDK Upgrade Assistant 
The new Android SDK upgrade assistant lets you see the steps required to upgrade the targetSdkVersion, or the API level that your app targets, directly in the IDE. It also pulls upgrade-related documentation directly from the Android Developer site into its tool window, so you don't have to jump back and forth between your browser and the IDE. For each migration step, it highlights the major breaking changes and how to address them, and even filters the full list of changes to only show steps relevant to your app.

To open the Android SDK Upgrade Assistant, go to Tools > Android SDK Upgrade Assistant.

Image of Android SDK Upgrade Assistant
Android SDK Upgrade Assistant

Improvements to the build system

Kotlin DSL in your Gradle build scripts 
Kotlin is not only more readable, it also offers better compile-time checking and IDE support. With Android Studio Giraffe, we are excited to offer the official support for Kotlin DSL in your Gradle build scripts. This means that Kotlin is the default language used in your project code, including UI with Jetpack Compose, and now editing the build scripts too!

Now, when you are creating new projects or modules starting from Android Studio Giraffe, you get the Kotlin DSL by default. And if you want to migrate existing builds, check out the Kotlin DSL migration guide.

We've been working with the Gradle and JetBrains teams on this improvement, and you can read more in their related announcements: Gradle Blog; JetBrains Blog.

Additionally, we’ve also added experimental support for TOML-based Gradle Version Catalogs, a feature that lets you manage dependencies in one central location and share dependencies across modules or projects. Android Studio now makes it easier to configure version catalogs through editor suggestions and integrations with the Project Structure dialog, plus the New Project Wizard.

Image of Android SDK Upgrade Assistant
Kotlin DSL in your Gradle build scripts

Download info during Gradle sync
 
If you’ve ever wondered if any unexpected dependency downloads are negatively impacting your sync performance, the new Sync tool window now includes a summary of time spent downloading dependencies, and a detailed view of downloads per repository. This view updates live as sync takes place. It can even help you identify inefficiencies in how you configure your repositories.

Moving image showing download info during gradle sync
Download info during Gradle sync

Automatic per-app language support 
Typically, multilingual users set their system language to one language—such as English—but they want to select other languages for specific apps, such as Dutch, Chinese, or Hindi. Android 13 introduced support for per-app language preferences, and now Android Gradle plugin 8.1 and higher can configure your app to support it automatically based on your project’s resources. Learn more.

Make selected modules toolbar button 
With Android Studio Giraffe, you can now build only the current module you're working on by selecting the Make Selected Modules build option in the toolbar. This new option lets you check that the code you just wrote compiles without building more than needed. Learn more.

Image of Android SDK Upgrade Assistant
Kotlin DSL in your Gradle build scripts

Summary

To recap, Android Studio Giraffe includes these new enhancements and features. You can always learn more with our detailed release notes.

IDE Enhancements
  • Upgraded to IntelliJ Platform 2022.3 : Includes a number of features and bug fixes
  • New UI for Android Studio : Android Studio now adopts a number of improvements from the IntelliJ's modern design language
  • Updated Device Explorer : Offers two new tabs : Files & Processes from where you can view a list of debuggable processes, perform a kill, force-stop, or attach the debugger
  • New diagnostic & bug reporting tool : Easier to report bugs for Android Studio with relevant log files already attached
Coding Productivity
  • Use Live Edit to update composables in real time : Update composables in real time, edit composables and see the UI changes on the running device without re-deploying your app
  • Compose Animation Preview - Extend animation support : Now supports a number of additional Compose APIs and new pickers that let you set non-enum or boolean states to debug your Compose animation using precise inputs
  • Android SDK Upgrade Assistant : Now lets you see the steps required to upgrade the targetSdkVersion, or the API level that your app targets directly in Studio
Improvements to the build system
  • Kotlin DSL in your Gradle build scripts : With official support for Kotlin DSL in your Gradle build scripts, Kotlin is now the single default language for project code, UI with Jetpack Compose, and now for build scripts
  • Download info during Gradle sync : Shows a summary of time spent downloading dependencies and a detailed view of downloads per repository
  • Automatic per-app language support : AGP can now automatically configure per-app language preferences
  • Make selected modules toolbar button : build only the current module you're working on by selecting the Make Selected Modules build option in the toolbar

Download Android Studio Today!

Now is the time to download Android Studio Giraffe 🦒 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!