Gradle version 2.3.3 download






















Additionally, KAPT 1. When you enable unit tests to use Android resources, assets, and manifests by setting includeAndroidResources to true , the Android Gradle plugin generates a test config file containing absolute paths, which breaks cache relocatability. You can instruct the plugin to instead generate the test config using relative paths, which allows the AndroidUnitTest task to be fully cacheable, by including the following in your gradle.

When using Kotlin Gradle plugin 1. To resolve this issue , upgrade the plugin to version 1. New lint check dependency configurations: The behavior of lintChecks has changed and a new dependency configuration, lintPublish , has been introduced to give you more control over which lint checks are packaged in your Android libraries.

The following code sample uses both dependency configurations in a local Android library project. In general, packaging and signing tasks should see an overall build speed improvement.

If you notice a performance regression related to these tasks, please report a bug. To make sure you can still build you instant app on future versions of the plugin, migrate your instant app to using the dynamic feature plugin , which also allows you to publish both your installed and instant app experiences from a single Android App Bundle.

R8 enabled by default: R8 integrates desugaring, shrinking, obfuscating, optimizing, and dexing all in one step—resulting in noticeable build performance improvements. R8 was introduced in Android Gradle plugin 3. Now, with R8, desugaring, shrinking, obfuscating, optimizing, and dexing D8 are all completed in one step, as illustrated below. So, in this unlikely situation, you might need to add additional rules to keep that code in your build output.

The correct usage of unique package names are currently not enforced but will become more strict on later versions of the plugin. On Android Gradle plugin version 3. To learn more about setting a package name through the Android Gradle plugin, see Set the application ID. Gradle 4. New features Improved classpath synchronization: When resolving dependencies on your runtime and compile time classpaths, the Android Gradle plugin attempts to fix certain downstream version conflicts for dependencies that appear across multiple classpaths.

For example, if the runtime classpath includes Library A version 2. However, if the runtime classpath includes Library A version 1.

To learn more, see Fix conflicts between classpaths. Improved incremental Java compilation when using annotation processors: This update decreases build time by improving support for incremental Java compilation when using annotation processors. For projects not using Kapt Java-only projects : If the annotation processors you use all support incremental annotation processing , incremental Java compilation is enabled by default.

To monitor incremental annotation processor adoption, watch Gradle issue If, however, one or more annotation processors do not support incremental builds, incremental Java compilation is not enabled. Instead, you can include the following flag in your gradle. When you include this flag, the Android Gradle plugin executes the annotation processors in a separate task and allows the Java compilation task to run incrementally. Better debug info when using obsolete API: When the plugin detects that you're using an API that's no longer supported, it can now provide more-detailed information to help you determine where that API is being used.

To see the additional info, you need to include the following in your project's gradle. You can also enable the flag by passing -Pandroid. Calling certain older methods in the Variants API, such as variant. To make sure that your build is optimized for lazy task configuration, invoke new methods that instead return a TaskProvider object, such as variant.

Faster R class generation for library projects: Previously, the Android Gradle plugin would generate an R. The plugin now generates a JAR containing your app's compiled R class directly, without first building intermediate R. This optimization may significantly improve build performance for projects that include many library subprojects and dependencies, and improve the indexing speed in Android Studio.

This optimization avoids the need for the device to make a copy of the library and thus reduces the on-disk size of your app. If you'd rather disable this optimization, add the following to your gradle. Single-variant project sync : Syncing your project with your build configuration is an important step in letting Android Studio understand how your project is structured.

However, this process can be time-consuming for large projects. If your project uses multiple build variants, you can now optimize project syncs by limiting them to only the variant you have currently selected. You need to use Android Studio 3. When you meet these requirements, the IDE prompts you to enable this optimization when you sync your project.

The optimization is also enabled by default on new projects. When enabling the optimization for projects with Kotlin content, Gradle sync falls back to using full variants internally.

To learn more, read Auto-download missing packages with Gradle. The Android Gradle plugin now uses version You no longer have to build, sign, and manage multiple APKs, and users get smaller downloads that are optimized for their device. To learn more, read About Android App Bundles.

Support for improved incremental build speeds when using annotation processors: The AnnotationProcessorOptions DSL now extends CommandLineArgumentProvider , which enables either you or the annotation processor author to annotate arguments for the processor using incremental build property type annotations.

Using these annotations improves the correctness and performance of incremental and cached clean builds. To learn more, read Pass arguments to annotation processors. Using this migration tool also sets the following flags to true in your gradle.

To learn more, read the AndroidX overview. New code shrinker, R8: R8 is a new tool for code shrinking and obfuscation that replaces ProGuard. To use AAPT2, make sure that you have the google dependency in your build. Native multidex is now enabled by default. Previous versions of Android Studio enabled native multidex when deploying the debug version of an app to a device running Android API level 21 or higher. The plugin now enforces a minimum version of the protobuf plugin 0.

The feature module plugin, com. For example, if your feature module name includes dashes, you get a build error. This behavior matches that of the dynamic feature plugin. DEX compilation is the process of transforming. Compared to the previous compiler, called DX, D8 compiles faster and outputs smaller DEX files, all while having the same or better app runtime performance.

D8 shouldn't change your day-to-day app development workflow. However, if you experience any issues related to the new compiler, please report a bug. You can temporarily disable D8 and use DX by including the following in your project's gradle. For projects that use Java 8 language features , incremental desugaring is enabled by default. You can disable it by specifying the following in your project's gradle.

Preview users: If you're already using a preview version of D8, note that it now compiles against libraries included in the SDK build tools —not the JDK. Because local modules can't depend on your app's test APK, adding dependencies to your instrumented tests using the androidTestApi configuration, instead of androidTestImplementation , causes Gradle to issue the following warning:.

Some of these changes break existing builds. So, you should consider the effort of migrating your project before using the new plugin. If you don't experience the performance improvements described above, please file a bug and include a trace of your build using the Gradle Profiler. This is a minor update to support Android Studio 3. Optimizations Better parallelism for multi-module projects through a fine grained task graph. When making changes to dependency, Gradle performs faster builds by not re-compiling modules that do not have access to that dependency's API.

You should restrict which dependencies leak their APIs to other modules by using Gradle's new dependency configurations : implementation , api , compileOnly , and runtimeOnly. Faster incremental build speed due to per-class dexing. Each class is now compiled into separate DEX files, and only the classes that are modified are re-dexed. You should also expect improved build speeds for apps that set minSdkVersion to 20 or lower, and use legacy multi-dex.

Improved build speeds by optimizing certain tasks to use chached outputs. To benefit from this optimization, you need to first enable the Gradle build cache. Improved incremental resource processing using AAPT2, which is now enabled by default. If you are experiencing issues while using AAPT2, please report a bug. You can also disable AAPT2 by setting android. New features Variant-aware dependency management. When building a certain variant of a module, the plugin now automatically matches variants of local library module dependencies to the variant of the module you are building.

To learn more about creating Feature modules with the new plugin, read Structure of an instant app with multiple features. Built-in support for using certain Java 8 language features and Java 8 libraries.

Jack is now deprecated and no longer required , and you should first disable Jack to use the improved Java 8 support built into the default toolchain.

For more information, read Use Java 8 language features. Added support for running tests with Android Test Orchestrator , which allows you to run each of your app's tests within its own invocation of Instrumentation. Because each test runs in its own Instrumentation instance, any shared state between tests doesn't accumulate on your device's CPU or memory. And, even if one test crashes, it takes down only its own instance of Instrumentation , so your other tests still run. Added testOptions.

By default, this property is set to HOST , which disables on-device orchestration and is the standard method of running tests. When you set this property to true , the plugin performs resource, asset, and manifest merging before running your unit tests.

Note: For library modules, the merged assets do not contain the assets of dependencies see issue This is a minor update that adds compatibility with Android Studio 2. This is a minor update to Android plugin 2.

If you want to apply an annotation processor at compile time but not include it in your APK, use the annotationProcessor dependency scope:. This update requires Gradle 2. Gradle 2. For more details, see the Gradle release notes. Note: Instant Run does not currently work with Jack and will be disabled while using the new toolchain. You only need to use Jack if you are developing for the N Preview and want to use the supported Java 8 language features. Added support for dexing-in-process which performs dexing within the build process rather than in a separate, external VM processes.

This not only makes incremental builds faster, but also speeds up full builds. The feature is enabled by default for projects that have set the Gradle daemon's maximum heap size to at least MB. You can do this by including the following in your project's gradle. If you have defined a value for javaMaxHeapSize in your module-level build. For example, if you have set javaMaxHeapSize to "m", you need to add the following to your project's gradle.

To disable dexing-in-process, add the following code to your module-level build. Note: A test APK module does not support product flavors and can only target a single variant. Also, Jacoco is not supported yet. Note: This version of the Android plugin for Gradle is not compatible with Gradle 2. Collectives on Stack Overflow.

Learn more. Android studio: android plugin version 2. Asked 4 years, 1 month ago. Active 4 years, 1 month ago. Viewed times. Thanks in advance.

Green J. Green 1. Where did you run the code; on virtual device or physical device? What version of android are those phones running on? On a physical device with android 5.

Add a comment. Active Oldest Votes. Sign up or log in Sign up using Google. Active Oldest Votes. This indeed fixed it. This is a huge issue as google support stuff not answering me! Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE.

Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.



0コメント

  • 1000 / 1000