Android studio preview


С чем столкнулись при переводе проекта на Android Studio 3.0 Preview и Gradle 4.0-milestone-1 / Хабрахабр

После того как на Google IO 2017 Keynote анонсировали новую Android Studio 3.0 Preview и Gradle 4.0-milestone-1, конечно же, руки сразу чесались все это попробовать. Если в первой просто появилось много интересных фишечек, то во втором серьезно поменялось API.

Поэтому хотел бы коротко поделиться с чем столкнулся при переводе текущего приложения на эти новшества. Это не будет какой то обобщенный туториал или обзор всех плюшек. Это лишь пошаговый список проблем с которыми столкнулись лично мы в компании LiveTyping для одного конкретного проекта.

Сразу перечислим какие зависимости есть в проекте и с чем могли возникнуть проблемы:

Шаг 1.

Советую установить Android Studio 3.0 Preview рядом со старой Android Studio 2.3, а не вместо нее. Был горький опыт, который быстро отучил обновляться из Canary канала. Мне посчастливилось быть одним из тех счастливчиков у которых при обновлении на Android Studio 2.2 Preview 1 студия начала рандомно крашиться и не сохранять последние 2-5 минут работы. Повторялось — не у всех, и не лечилось до Preview 6. Откат не помогал.

Шаг 2.

Запустив свой проект на новой студии мы сразу же увидим сообщение

Либо соглашаемся сразу, либо делаем все руками

В %PROJECT%/gradle/wrapper/gradle-wrapper.properties заменяем

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

на

distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip

В %PROJECT%/build.gradle заменем

buildscript { dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' } }

на

buildscript { dependencies { + classpath 'com.android.tools.build:gradle:3.0.0-alpha1' } }

Но тут один есть нюансик. Android Studio пока сама не добавляет репозиторий для скачивания android gradle plugin 3.0.0-alpha1. Поэтому, в любом случае, придется сделать это руками. Добавляем в %PROJECT%/build.gradle

buildscript { repositories { maven { + url 'https://maven.google.com' } }

Шаг 3.

После синхронизации проекта появилась новая ошибка

Это наш самописный таск, который переименовывал apk файлы в удобный нам формат. Идем в инструкцию по миграции на новый android gradle plugin и в самом низу видим следующее

API change in variant output Using the Variant API to manipulate variant outputs is broken with the new plugin. If you're using this API with the new plugin, you'll see the following error message: Error:(41, 0) Not valid. This build error occurs because variant-specific tasks are no longer created during the configuration stage. This results in the plugin not knowing all of its outputs up front, but it also means faster configuration times. As an alternative, we will introduce new APIs to provide similar functionality.

Что ж, пока деваться некуда — просто закомментируем весь таск и живем так. Ждем когда появится новое API.

Позднее мы увидим что теперь apk файлы кладутся не в %PROJECT%/app/build/outputs/apk/ как раньше, а для них создаются отдельные каталоги по buildtypes и flavors. В нашем случае это 2 каталога

%PROJECT%/app/build/outputs/apk/debug %PROJECT%/app/build/outputs/apk/release

И в каждом из них лежат 2 файла:

app-debug.apk output.json

Если с первым все ясно, то интересно содержимое второго файла

[ { "outputType": { "type": "APK" }, "apkInfo": { "type": "MAIN", "splits": [], "versionCode": 10000 }, "outputFile": { "path": <FULL_APK_PATH> }, "properties": { "packageId": <YOUR_PACKAGE_NAME>, "split": "" } } ]

Отлично, его можно использовать автоматизации аплоада apk файла.

Шаг 4.

После очередной синхронизации проекта мы увидим следующее сообщение

Information:Gradle tasks [:app:generateDebugSources, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources] Warning:The Jack toolchain is deprecated and will not run. To enable support for Java 8 language features built into the plugin, remove 'jackOptions { ... }' from your build.gradle file, and add android.compileOptions.sourceCompatibility 1.8 android.compileOptions.targetCompatibility 1.8 Future versions of the plugin will not support usage of 'jackOptions' in build.gradle. To learn more, go to https://d.android.com/r/tools/java-8-support-message.html Warning:One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html Warning:One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html

В целом здесь мы видим 2 сообщения

a. The Jack toolchain is deprecated и требуется полностью избавиться от его упоминания. Вспоминаем что это действительно так и удаляем jackOptions из файла %PROJECT%/app/build.gradle

android { defaultConfig { - jackOptions { - enabled false - } } }

b. Новая Android Studio 2.4 Preview частично поддерживает Java8 и Retrolambda больше не нужна. В соответствии с рекомендациями по миграции удаляем ее из проекта.

В файле %PROJECT%/build.gradle

buildscript { dependencies { - classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' - classpath 'me.tatarka:gradle-retrolambda:3.3.0' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } - // Exclude the lombok version that the android plugin depends on. - configurations.classpath.exclude group: 'com.android.tools.external.lombok' }

В файле %PROJECT%/app/build.gradle

- apply plugin: 'me.tatarka.retrolambda'

Добавляем поддержку Java8, если ее еще не было

android { compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } }

Шаг 5.

В соответствии с новым Gradle API заменяем dependency configurations

compile -> implementation provided -> compileOnly

ни и для пущего понимания

debugCompile -> debugImplementation releaseCompile -> releaseImplementation debugProvided -> debugCompileOnly releaseProvided -> releaseCompileOnly testCompile -> testImplementation androidTestCompile -> androidTestImplementation

ну или как то там, в соответствии с вашими buildtypes и flavors.

Шаг 6.

Еще ранее в проекте мы уже заменили apt plugin на annotationProcessor. Удалили все упоминания android-apt в файле %PROJECT%/build.gradle

buildscript { dependencies { - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } }

И в файле %PROJECT%/app/build.gradle

- apply plugin: 'com.neenbedankt.android-apt'

И заменили в зависимости

apt -> annotationProcessor

После чего вам потребуется пересмотреть репозитории соответствующих библиотек (таких как Dagger2, StorIO, AutoValue, Butterknife, Timber, Moxy и другие) и заменить адреса их зависимостей целиком. Однако тут мы столкнулись с одной нерешаемой проблемой с крайне полезной библиотекой IcePick, которая, к сожалению, не поддерживает annotationProcessor и Kotlin.

Однако ребята из Evernote сделали свою аналогичную библиотеку Android-State, SNAPSHOT версия которой отлично справляется и имеет API похожее на API IcePick.

repositories { jcenter() maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' } } dependencies { + implementation 'com.evernote:android-state:1.1.0-SNAPSHOT' + annotationProcessor 'com.evernote:android-state-processor:1.1.0-SNAPSHOT' }

Шаг 7.

И уже в самом конце нас ждал еще один сюрприз

Сразу может показаться что какая-то проблема с multidex. На самом деле оказалось что проблема с используемым нами dexcount-gradle-plugin. На страничке плагина мы увидели сообщение:

NOTE: dexcount does not currently work with the new Android Build Tools as of 3.0.0-alpha1; it has removed APIs that we depend on and, while replacements have been promised, none have yet been provided.

Ну что ж, пока тоже комментируем использование этого плагина и ждем правок.

Итог

Это был последний пункт, после которого проект успешно завелся. Это достаточно частный случай, но может быть кому то поможет быстрей разобраться в их проблемах миграции. Пишите в комментариях собираетесь ли пробовать на новую студию и Gradle в ближайшее время или собираетесь ждать релиза. С какими проблемами столкнулись вы?

Полезные ссылки:

  1. Android Studio 3.0 Preview 1
  2. New android plugin migration
  3. Java8 support
  4. Java8 language features support update

habrahabr.ru

Preview Channels - Android Studio Project Site

Android Studio has a built-in preview update mechanism. The IDE connects regularly to the update server and will present a popup at startup when a new version is available.

Android Studio categorizes updates using "channels". There are 4 channels available:

  • Canary channel: Canary builds are the bleeding edge, released about weekly. While these builds do get tested, they are still subject to bugs, as we want people to see what's new as soon as possible. This is not recommended for production development.
  • Dev channel: Dev builds are hand-picked older canary builds that survived the test of time. It should be updated roughly bi-weekly or monthly.
  • Beta channel: When we reach a beta milestone for the next version of Android Studio, we post the beta builds here. When the version is stable, the beta channel contains the stable version until the next version's beta.
  • Stable channel: Contains the most recent stable version of Android Studio. 
To then configure which channel to use for automatic updates:
  1. Open the Settings dialog (File > Settings on Windows/Linux, or Android Studio > Preferences on Mac). 
  2. In the left panel, select Appearance & Behavior > System Settings > Updates, then select a channel from the drop-down list.

Using Multiple Android Studio Versions

It's possible to have multiple versions of Android Studio installed simultaneously. When we offer canary builds (or even beta builds) of the next version of the IDE, you may want to install the new version without replacing your existing stable install.

Android Studio stores its settings in version specific folders; the exact locations depend on the operating system (and the versions of the IDE), but for example, if you have both Android Studio 1.5.1 and Android Studio 2.0 Preview 1 installed, these will consult settings in

and

~/.AndroidStudioPreview2.0

respectively.

Therefore, once you've installed the two versions, you can use them, even side by side, and they should not interfere with each other. (Note however that newer versions of the may change some of the configuration data in your projects (such as code style settings in .idea).

Note that on OSX, you typically install by just dragging the "Android Studio" app from the DMG folder to your Applications folder. Doing so will cause it to replace the previous install with the new install. To avoid this, rename your existing app first, for example from "Android Studio" to "Android Studio 1.5".

Deleting Older Settings Folders

Once you are done with an older version, you can delete the settings folder for that version. This can free up a significant amount of disk space; particularly the index caches.

Accepting Android Studio Updates

When an update is available, you'll see a balloon notification in the IDE.

Two important known issues:

  • The first time, you'll see a dialog that asks you to accept this channel. You need to press "More info" to accept this channel, otherwise you won't get notified about updates. 
  • If you press the "Ignore This Update" button, there is currently no mechanism available to revert that decision and Android Studio will never tell you about that update ever again.

We'll revisit this to make it a bit more understandable.

TL;DR: you need to press "More Info..." on that dialog, then check for updates again.

 Later on, you'll just see the update information dialog, which details information on the patch available, its size and its channel:

 

The options are:

  • Update and restart will automatically download the patch, close Android Studio, apply it and restart Studio.
  • Release Notes opens a web page with releases notes.
  • Remind Me Later closes this dialog. Updates are checked daily so it will notify you again in 24 hours or so.
  • Ignore This Update puts the specific build number on a list to be skipped. There is no undo mechanism for that nor any UI to edit the exception list (but there are workarounds.) The update mechanism will ask again for the next update though.

SDK Manager: Tools Previews

From time to time the Android SDK team will release previews for the Android SDK tools -- these let developers get an idea of the future changes to the tools and provide us with early feedback. We try to make sure they are reasonably stable releases. 

There are two kind of previews that we can release:

  • From the SDK Manager, developers can get previews of Tools and Platform-Tools packages.
  • From the Eclipse update site, developers can get previews of the ADT plugin for Eclipse.

Please see the details below on how to configure your system to get these and how to "roll" back to the stable versions.

To find out the latest features available in the SDK tools, check the 

Recent Changes

 page.

To enable Tools and Platform-Tools previews in the SDK Manager:

  • Open the SDK Manager, typically by running the android tool.
  • Open Tools > Options...
    • For Mac OSX, use SDK Manager > Preferences...NOTE: Due to a bug the SDK Manager may not show a menu. If that is the case, switch to a different application and then return; that should fix the menu.
  • Check "Enable Preview Tools"
  • Once you close the options dialog, the SDK Manager will display both the latest stable version of the tools and the latest preview available.
  • To install the preview version of the tools, simply select the "Android SDK Tools" package in the "Tools (Preview Channel)" section and click install. This replace the existing tools by the preview version.
  • If you later decide you want to go back to the previous version, simply select the "Android SDK Tools" package in the "Tools" section and click install. This will replace the tools.

tools.android.com

Android Profiler in Android Studio 2.4 preview

This page is obsolete. You're being redirected to developer.android.com/studio/preview/features/android-profiler.html

The new Android Profiler window in the Android Studio 2.4 preview replaces the Android Monitor. The advanced profiling tools display realtime data updates for CPU, memory, and network activity.

The default view in the Android Profiler window, as shown in figure 1, displays a simplified set of data for each profiler. You must first select (1) the device and (2) the app process you want to profile. You can then click one of the graphs to see the more detailed timeline. Every view also includes (3) timeline zoom controls, (4) a button to jump to the realtime data, and an (5) event timeline that shows the lifecycle of activities and see all input events and screen rotation events.

Figure 1. The Android Profiler overview, showing the timeline for all profilers

CPU Profiler

The CPU Profiler shows realtime CPU usage for your app process and system-wide CPU usage on a timeline.

You can select between (1) a traditional instrumented trace (method traces) and a sample-based trace. Then click (2) Record to begin tracing your code. Once you're done recording, the timeline indicates (3) the captured region, you can (4) view the state of each thread, and (5) see either a top-down list, bottom-up list, or flame chart for the methods that have executed during the recording.

Figure 2. The CPU Profiler, with results from sampled method tracing

Memory Profiler

The Memory Profiler view combines the features from Heap Viewer, Allocation Tracker, and Memory Monitor, so you can view realtime count of allocated objects and garbage collection events on a timeline, capture heap dumps, and record memory allocations, all from one interface.

The Memory Profiler shows the amount of memory used by your app on a timeline, according to the memory size on the left y-axis. Each memory type (such as Java, Native, and Graphics) is indicated with a different color in a stacked graph. The total number of objects allocated by your app is indicated with a dotted line, according to the y-axis on the right. Values for each are also specified in a key at the top of the graph.

The toolbar at the top of the window allows you to (1) Force garbage collection, (2) Capture a heap dump, and (3) Record memory allocations.

Figure 3. The Memory Profiler, with results from a memory allocation recording

When you capture a heap dump or record memory allocations, the (4) recording event is indicated on the timeline. Your results then appear in (5) the pane below the timeline. In figure 2, this window shows the memory allocation results during the time indicated in the timeline. When viewing either a heap dump or memory allocations, you can select a class name from this list to view the (6) list of instances on the right. Clicking an instance there, reveals (7) a third pane below, showing either the stack trace for where that memory was allocated (when viewing the allocation record), or the remaining references to that object (when viewing a heap dump).

You can also capture a heap dump while memory allocation tracking is turned on to get stack traces in the heap dump (for objects allocated after allocation was turned on).

Network Profiler

The Network Profiler displays realtime network activity on a timeline, showing data sent and received, as well as the current number of connections. At the top of the window, you can see the event timeline and (1) radio power state (high/low) vs Wi-Fi.

On the timeline, you can (2) click and drag to select a portion of the timeline to inspect the traffic. The (3) window below then shows files sent and received during the selected portion of the timeline, including file name, size, type, status, and time. You can sort this list by clicking any of the column headers. You also see a detailed breakdown of the selected portion of the timeline, showing when each file was sent or received.

Click a file name to view (4) detailed information about a selected file sent or received. Click the tabs to view the response data, header information, or the call stack.

Figure 4. The Network Profiler, showing a network request and response

Network Connection Troubleshooting

If the Network Profiler detects traffic values, but cannot identify any supported network requests, you will receive the following error message:

“No connections supported for instrumentation.”

Currently, the Network Profiler only supports the HttpURLConnection library for network connections. If your app uses another network connection library, you will not be able to view your network activity in the Network Profiler. If you have received this error message, but your app does use HttpURLConnection, please report a bug so we can investigate the issue.

tools.android.com

About Android Plugin for Gradle 3.0.0

  1. What to expect from performance
  2. Known issues

Known issue: If you have an existing Android Studio project that's using an alpha version of Android plugin 3.0.0 (such as 3.0.0-alpha9), you may get the following error when you migrate to Android plugin 3.0.0-beta1 and sync your project: Gradle project refresh failed.

Resolve this issue by selecting Build > Clean Project from the menu bar—you need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the menu bar.

Android plugin 3.0.0-beta1 and higher include the following updates that help address bugs and performance issues of large Android projects:

In order to bring about these improvements, there are some breaking changes in the plugin behavior, DSL, and APIs. These breaking changes impact both build files and Gradle plugins. There may also be more breaking changes before the stable release of the plugin, so you should keep checking this page.

For instructions on how to migrate your own project to use this plugin, go to Migrate to the new plugin.

What to expect from performance

The main focus of this version is to address the build performance issues of Android projects with a large number of modules. When using the new plugin with these projects, you should experience the following:

This is a first step, with a strong focus on improving scalability and parallelism, and on improving tasks to be more incremental. You can expect more changes in later preview releases and down the line after the first stable release.

On a test skeleton project with ~130 modules and a large number of external dependencies, but no code/resources, we are seeing the following performance improvements:

Android plugin version + Gradle version Android plugin 2.2.0 + Gradle 2.14.1 Android plugin 2.3 RC1 + Gradle 3.3 Android plugin 3.0 preview + Gradle 4.0-milestone-1 Configuration (e.g. running help) 1-line Java change (implementation change)
~2 mins ~9 s ~2.5 s
~2 mins 15 s ~29 s ~6.4 s

To try the new plugin on your own projects. If you see less of a performance improvement than you expected, we are looking for feedback with build profiling. Please consider using the Gradle Profiler to provide us with more data. File a bug and include a Chrome trace of your build using the Gradle Profiler.

Known issues

This site uses cookies to store your preferences for site-specific language and display options. OK

You have successfully signed up for the latest Android developer news and tips.

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

developer.android.com

Android Studio 2.0 Preview 5 Available

posted Jan 14, 2016, 10:46 AM by Tor Norbye
We've just pushed Android Studio 2.0 Preview 5 to the canary channel. This build contains a large number of fixes relative to Preview 4 from last month, including
  • Instant Run: We've made a huge number of changes in this area. Among the user visible features, we now support "cold swap": if there is an incompatible change that can't be hot swapped, it now builds and deploys incremental changes and restarts the app. We use several different methods for this, depending on the API level of the target device:
    • On Android Marshmallow, we use "APK splits", dividing the codebase up into slices that are packaged as individual APK slices, and install these via adb install-multiple. This means that on M, we don't need to use the class loader tricks that we use on older platforms.
    • On Android Lollipop, we use multidex to split the app code into dex slices, and push those.
    • On Android KitKat and below, we create a single dex file containing the changed classes.
    • In addition to "coldswap", which restarts a running app after applying incompatible changes, we also support "freeze swap" where we support building incrementally even when the app isn't originally running. In that case, we push the changes via adb to an "inbox" directory on the device.
    • Note that Instant Run now requires a new version of the Gradle plugin: 2.0-alpha5 (also released today) - release notes for the plugin
  • Lint
    • There is a new "Remove Unused Resources" refactoring which finds and removes unused resources in the project.
    • The unused resource detector has been rewritten, and now supports flagging "transitive" unused resources (resources that are referenced, but only from other unused resources), supports detecting resource references in raw files such as .html image references, and supports the tools:keep and tools:discard attributes used by the Gradle resource shrinker, it considers inactive source sets (e.g. resources defined in other product flavors and build types), and properly handles static field imports. It now also has a quickfix for removing unused resources.
    • Implicit API checks. Until now, lint has checked that method calls and field references are supported on all platforms targeted by your minSdkVersion. However, there are a number of classes that have started implementing new interfaces, such as Closeable, in later levels - or that have even changed which super class they extend. For example, KeyEvent only has InputEvent as a super class as of API 9. That means that in all the places where you have an implicit or explicit cast, you also have a potential crash. Lint now tracks these API changes and checks all implicit casts:
    • Several new lint checks - one looking for a common pitfall in RecyclerView usage, one looking for a potential crash with Parcelable loading, as well as 8 lint checks ported from bytecode analysis to in-IDE analysis such that they can run in the background in the editor.

    • The @IntDef, @IntRange and @Size inspections are now checked not just for primitive ints, but for int arrays and varargs as well.
    • A number of other miscellaneous improvements, such as lint now running even when there are syntax errors in the current file being edited, exposing lint issue categories in the IDE analysis window, fixes to make third party lint rules (provided from AAR libraries) work better inside the IDE, etc.
  • Data binding: The XML editor now support code completion for data binding expressions.
  • Test Artifacts: The experimental test artifacts feature (where both unit test and instrumentation tests are enabled simultaneously in the IDE) has been improved further and is now enabled by default.
  • Code completion inside style tags should now work better; it looks up the parent styles and suggests eligible items.
  • We've also been working on improving the accessibility support, as well as infrastructure work on the SDK manager and the wizard infrastructure.
  • And as always - a large number of bug fixes. Please let us know if there are new problems, or if the fixes aren't working correctly!

Installation

You can update your current 2.0 Preview installation to Preview 5 via the built-in patch mechanism (Check for Updates).

Problems?

If you run into problems, be sure to check the 

Known Issues

 page which we'll update as necessary.

tools.android.com

Android Emulator Preview | Android Studio

Android Emulator 26.2.0 is now available when you enable updates from the Canary Channel.

This version introduces Quick Boot to significantly speed up the emulator start time. This feature is enabled by default for all AVDs. Although the first time you start an AVD it must perform a cold boot (just like powering on a device), all subsequent starts are fast and the system is restored to the state at which you closed the emulator (similar to waking a device).

Quick Boot options

If you want to disable Quick Boot so your AVD always performs a cold boot, proceed as follows:

  1. Open the AVD Manager and click Edit this AVD .
  2. Click Show Advanced Settings and then scroll down to Emulated Performance.
  3. Select Cold boot.

Or, instead of disabling Quick Boot completely, you can cold boot just once by clicking Cold Boot Now from the AVD's drop-down menu in the AVD Manager.

Command line options

Quick Boot can also be controlled from the command line on a per-emulator-launch basis.

Troubleshooting

There are cases when emulator fails to boot from a snapshot and ends up in a broken state. To fix it, select Cold Boot Now from the AVD Manager and send us a bug report so we can investigate.

Known issues

This site uses cookies to store your preferences for site-specific language and display options. OK

You have successfully signed up for the latest Android developer news and tips.

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

developer.android.com

Recent Changes - Android Studio Project Site

Android Studio 2.4 Preview 2 is now available
posted Mar 16, 2017, 10:41 AM by Chris Iremonger

Android

Studio 2.4 Preview 2

is now available in the Canary and Dev Channels.

This includes all the changes from

Preview 1

with the following additional fixes in Preview 2:

  • Software Updates should now notifying you correctly and only when there are updates.
  • Mac builds should be signed fully and no longer present a warning
  • Patching should be working again making it easier to move to preview 3

We appreciate all of your feedback on Preview 1 and hope Preview 2 resolves some of your installation pain points. Please keep the feedback coming.

Android Studio 2.4 Preview 1 is now Available
posted Mar 14, 2017, 2:34 PM by Chris Iremonger   [ updated Mar 16, 2017, 10:42 AM ]

We have just released Android Studio 2.4 Preview 1 to the Canary and Dev Channels. This is an early build, so expect more updates over the coming weeks.

Major changes include:

     Code:

  • In Android Studio 2.4 Preview 1 we upgraded the base IDE from IntelliJ 2016.2 to 2017.1 EAP, which adds a number of new features in 2016.3 and 2017.1 -- including parameter hints, semantic highlighting, instant results in search, and much more.
  • Many new lint checks

     Instant Run:

  • Instant Run Debug Issue 234401 should now be resolved. If a program is paused on breakpoint, app restarting is expected. But if the app is not paused on a breakpoint, it shouldn’t restart and hot swap should work when you only make a method implementation change.

     Build:

  • Incremental dex’ing. Dex’ing is now done at a per class level. This allows for more incrementality and will result in faster incremental builds. You should also expect improved build speeds for applications using legacy multi-dex (minSdkVersion < 21).

  • Dependency resolution at execution time. In previous versions, dependency resolution occurs during Gradle configuration time. By moving dependency resolution to execution time, you should expect improved configuration times for large projects.

     IDE:

  • Android Studio on the mac will now be called “Android Studio 2.4 Preview.app” to make it easier for you to run 2.3 stable with the new previews side by side.

  • Device File Explorer - Seamlessly view, modify and interact with device filesystems directly in Android Studio. This feature replaces device filesystem interactions previously accomplished through DDMS (Dalvik Debug Monitor Server)

Known Issues: 

  • If you check for updates it will tell you there is a new version of Android Studio 2.4 Preview 1 (build 171.3804684). This is the same build you already have installed. Please don't try to download it again. We will have a fix included in Android Studio 2.4 Preview 2. [Now resolved in Preview 2]
  • Mac builds may prompt you saying it can't be opened because it is from an unidentified developer. The zip appears to signed, but has issues. We will update it in Preview 2. If you want to try it in preview 1, please right click and select open.  [Now resolved in Preview 2]
ConstraintLayout 1.0.2 is now available
posted Mar 7, 2017, 3:17 PM by Nicolas Roard

We just published ConstraintLayout 1.0.2. As always, it's available in the SDK Manager (under the "Support Repository" section). We recommend to update to this version.

Note: with Android Studio 2.3 being released, we strongly encourage people to switch to it for editing layouts (ConstraintLayout included). Many improvements have been made since 2.2, providing a smoother experience.

Changes:

  • fixed wrap content issues if specifying padding on the ConstraintLayout component
  • handles programmatic setId() calls on ConstraintLayout component correctly
ConstraintLayout 1.0.1 is now available
posted Mar 1, 2017, 4:32 PM by Nicolas Roard

We just published ConstraintLayout 1.0.1. As always, it's available in the SDK Manager (under the "Support Repository" section). We recommend to update to this version.

Note: with Android Studio 2.3 reaching release candidate status, we also encourage people to switch to it for editing layouts (ConstraintLayout included). Many improvements have been made since 2.2, providing a smoother experience.

Key changes:

  • fixed some wrap content issues (e.g in scrollview) 
  • better gone handling in chains with match_constraint
  • minimum dimensions applied to ConstraintLayout will take in account padding
ConstraintLayout 1.0 is now available
posted Feb 22, 2017, 6:24 PM by Nicolas Roard

After months of intensive development, we are delighted to announce the 1.0 release of the ConstraintLayout library. It's available as a small unbundled library, in the Android Studio SDK Manager (under the "Support Repository" section), compatible with API level 9 (Gingerbread and above). We recommend updating to this version, particularly if used in production.

Note: with Android Studio 2.3 reaching release candidate status, we also encourage people to switch to it for editing layouts (ConstraintLayout included). Many improvements have been made since 2.2, providing a smoother experience.

The ConstraintLayout library allows you to create complex layouts easily, avoiding deep nested hierarchies and providing many powerful features for designing UIs:

  • Relative positioning of widgets to parent or siblings

  • Centering positioning and bias control

  • Flexible size control (min/max/wrap/constrained)

  • Per axis group behavior (chains, weights)

  • Advanced visibility behavior (gone handling and margins)

  • Horizontal and Vertical virtual guidelines (fixed positions or percentage-based)

  • Aspect Ratio support

  • Advanced API to set constraints programmatically, allowing easy animations between layouts

A code lab is available as an introduction to ConstraintLayout as well as a developer guide. A complete online documentation is also available. Many excellent tutorials have also been created by the developers’ community; you can find them on YouTube, Medium, or your favorite search engine.  

Changes since beta5: bug fixes related to wrap_content, support for MEASURE_STATE_TOO_SMALL.
ConstraintLayout beta 5 is now available
posted Feb 9, 2017, 6:20 PM by Nicolas Roard   [ updated Feb 10, 2017, 7:46 AM ]

We just published ConstraintLayout beta 5. As always, it's available in the SDK Manager (under the "Support Repository" section). We recommend to update to this version -- it will be the last beta before 1.0 and is considered as the release candidate.

Key Changes:

  • Use of MATCH_PARENT now throws exception

  • Improved performance in wrap_content use cases (30-40%)

  • Better view dimension control (6 new attributes)

  • Improved behaviour of gone in chains

  • Aspect ratio enhancements

  • Increased coverage of apis in ConstraintSet (chains, transforms, etc.). See documentation.

Note: if you are using Android Studio 2.2, you might have to do File->Invalidate Caches & restart studio after installing this version (the editor behavior may not be correct, with widgets temporarily snapping to the top left corner or not shown). Using Android Studio 2.3 is strongly encouraged.

MATCH_PARENT

MATCH_PARENT is not valid in ConstraintLayout when set on its children, and its behavior undefined. To reduce the risk of errors we now throws an exception if we encounter it.

Improved performance

This release fixes a few issues and performance improvements (notably, wrap_content measure on the layout got a ~30-40% speed bump).

Better view dimension controls

The new available behaviors when a dimension is set to 0dp (MATCH_CONSTRAINT). As before, both endpoints (left/right or top/bottom) need to be connected to targets.

  • layout_constraintWidth_default = spread (default, similar to the previous behavior)

  • layout_constraintWidth_default = wrap

  • layout_constraintHeight_default = spread

  • layout_constraintHeight_default = wrap

Additionally, minimum and maximum dimensions can be specified (they will only apply to MATCH_CONSTRAINT widgets):

  • layout_constraintWidth_min = [dimension]

  • layout_constraintWidth_max = [dimension]

  • layout_constraintHeight_min = [dimension]

  • layout_constraintHeight_max = [dimension]

Spread provides the previous behaviour of expanding to fill the area defined by the constraints.

Wrap provides a significant new behaviour, with the widget resizing as if wrap_content was used, but limited by the connected constraints. A widget will thus not grow beyond the endpoints.

Gone Behavior in Chains

Previously, this was not handled -- views in a Chain would disappear but still take space. Now, if a view in a chain is marked as GONE, the chain will react as if the view didn’t exist.

Improved Ratio Support

Here the widget has both dimension set to MATCH_CONSTRAINT (0dp), and the attribute layout_constraintDimensionRatio=”16:9”

Android Studio 2.3 Beta 4 is now available
posted Feb 9, 2017, 2:32 PM by Chris Iremonger   [ updated Feb 9, 2017, 6:37 PM ]

We have just released

Android Studio 2.3 Beta 4

to the Canary and Dev Channels.

Android Studio 2.3 Beta 4 has already completed the first level of testing and wanted to share the bits with as soon as possible. Once the build passes all testing we will release it to the Beta 

channel.

Fixed Issues

Please continue to submit feedback as we are nearing a close to the 2.3 release sprint.
Android Emulator Revision 25.3.0 (Feb 2017)
posted Feb 8, 2017, 5:20 PM by Chris Iremonger   [ updated Feb 11, 2017, 9:20 AM by J. Eason ]

First release upon separating the emulator from

SDK Tools

in the Canary and Dev channel. There have been changes to

SDK Tools 25.3

which is also released to the Canary channel with this Emulator update.

Dependencies:

  • Android SDK Platform-tools revision 24 or later.
  • Android SDK tools 25.3.0

New Android Emulator features and Bug Fixes:

  • Fully GLES 2.0 compliant. Given a host GPU that has conformant desktop OpenGL drivers, the emulator now passes 100% of CTS dEQP-GLES2 must-pass.
  • Swiftshader as a pure software renderer on the host
  • Initial IPV6 support.
  • Improved pipe performance - Android Pipe, the main communication channel between the emulator and Android OS, is much (order of magnitude) faster, has lower latency and has better threading performance (especially noticeable on x64 images). This improves ADB push/pull speed, 3D acceleration support and overall responsiveness of the emulator.
  • Improved audio support
  • Improved video playback performance. The emulator now stores all video color buffers in host/guest shared memory and performs any needed final YUV->RGB conversion in the GPU. 1080p30 (even 60) should be well within reach of most systems now. (but only when new images are released)
  • Faster disk IO - Emulator now uses separate thread to dispatch disk IO, resulting in much lower latency and improved throughput (~1.5x sequential, ~5x random access).
  • Improved graphics performance. Android Pipe improvements have also increased graphics performance! In addition, the emulator will use GPU-side buffers (glBindBuffers / glBufferData) when the guest requests them, decreasing CPU overhead in some apps. More to come when new system images are released.
  • Various GUI enhancement
Android SDK Tools Revision 25.3.0 (Feb 2017)
posted Feb 8, 2017, 5:19 PM by Chris Iremonger   [ updated Feb 9, 2017, 10:14 AM ]

We have just released Android SDK Tools 25.3.0 to the canary channel to give developers an early look at some of our changes.

Dependencies:

  • Android SDK Platform-tools revision 24 or later.

Changes:

  • Android Emulator is removed from this package and moved to a different SDK directory. See the new Android Emulator Release Notes. This change is backward compatible with older studio versions.
  • "android avd" command-line functionality replaced with new avdmanager tool. 
  • Obsolete/deprecated tools have been removed:
    • android
    • ddms
    • draw9patch
    • hierarchyviewer
    • traceview
    • ant scripts
    • Project and activity templates
  • Executables have been moved to bin/
    • jobb
    • lint
    • monkeyrunner
    • screenshot2
    • Uiautomatorviewer
  • Enhanced sdkmanager
    • View and accept all licenses from the command line
    • Improved verbose-mode package list

Please file feedback on

b.android.com

for any issues you find in this update.

Post Updates:

  • February 9: 
    • It appears the verbose mode did not make it into this release and should come in the next update. [bug: 229373]
    • Running "avdmanager --list" results in a ClassCastException [bug: 233816]

tools.android.com


Смотрите также