সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অ্যান্ড্রয়েড গ্রেডল প্লাগইন 2.2.0 (সেপ্টেম্বর 2016)
- নির্ভরতা:
- নতুন:
- Gradle 2.14.1 ব্যবহার করে, যার মধ্যে কর্মক্ষমতার উন্নতি এবং নতুন বৈশিষ্ট্য রয়েছে, এবং একটি নিরাপত্তা দুর্বলতা সংশোধন করে যা Gradle ডেমন ব্যবহার করার সময় স্থানীয় বিশেষাধিকার বৃদ্ধির অনুমতি দেয়। আরও বিশদ বিবরণের জন্য, গ্রেডল রিলিজ নোটগুলি দেখুন।
-
externalNativeBuild {}
DSL ব্যবহার করে, Gradle এখন আপনাকে আপনার নেটিভ সোর্সের সাথে লিঙ্ক করতে দেয় এবং CMake বা ndk-build ব্যবহার করে নেটিভ লাইব্রেরি কম্পাইল করতে দেয়। আপনার নেটিভ লাইব্রেরি তৈরি করার পরে, Gradle সেগুলিকে আপনার APK এ প্যাকেজ করে। Gradle এর সাথে CMake এবং ndk-build ব্যবহার সম্পর্কে আরও জানতে, আপনার প্রকল্পে C এবং C++ কোড যোগ করুন পড়ুন। - যখন আপনি কমান্ড লাইন থেকে একটি বিল্ড চালান , গ্রেডল এখন আপনার প্রকল্পের উপর নির্ভর করে এমন কোনো অনুপস্থিত SDK উপাদান বা আপডেটগুলি স্বয়ংক্রিয়ভাবে ডাউনলোড করার চেষ্টা করে। আরও জানতে, Gradle এর সাথে অনুপস্থিত প্যাকেজগুলি অটো-ডাউনলোড করুন ।
- একটি নতুন পরীক্ষামূলক ক্যাশিং বৈশিষ্ট্য গ্র্যাডলকে আপনার লাইব্রেরির পূর্ব-ডেক্স করা সংস্করণগুলিকে প্রাক-ডেক্সিং, সংরক্ষণ এবং পুনঃব্যবহারের মাধ্যমে বিল্ড সময়ের গতি বাড়াতে দেয়। এই পরীক্ষামূলক বৈশিষ্ট্যটি ব্যবহার করার বিষয়ে আরও জানতে, বিল্ড ক্যাশে নির্দেশিকা পড়ুন।
- একটি নতুন ডিফল্ট প্যাকেজিং পাইপলাইন গ্রহণ করে বিল্ড কর্মক্ষমতা উন্নত করে যা একটি কাজে জিপিং, সাইনিং এবং জিপলাইনিং পরিচালনা করে। আপনি আপনার
gradle.properties
ফাইলে android.useOldPackaging=true
যোগ করে পুরোনো প্যাকেজিং সরঞ্জামগুলি ব্যবহার করে ফিরে যেতে পারেন। নতুন প্যাকেজিং টুল ব্যবহার করার সময়, zipalignDebug
টাস্ক উপলব্ধ নেই। যাইহোক, আপনি createZipAlignTask(String taskName, File inputFile, File outputFile)
পদ্ধতিতে কল করে নিজেই একটি তৈরি করতে পারেন। - APK সাইনিং এখন প্রথাগত JAR সাইনিং ছাড়াও APK স্বাক্ষর স্কিম v2 ব্যবহার করে। সমস্ত অ্যান্ড্রয়েড প্ল্যাটফর্ম ফলস্বরূপ APK গ্রহণ করে। স্বাক্ষর করার পর এই APK-তে যেকোনো পরিবর্তন তাদের v2 স্বাক্ষরকে অবৈধ করে এবং একটি ডিভাইসে ইনস্টলেশনকে বাধা দেয়। এই বৈশিষ্ট্যটি নিষ্ক্রিয় করতে, আপনার মডিউল-স্তরের
build.gradle
ফাইলে নিম্নলিখিত যোগ করুন: গ্রোভি
android {
...
signingConfigs {
config {
...
v2SigningEnabled false
}
}
}
কোটলিন
android {
...
signingConfigs {
create("config") {
...
v2SigningEnabled = false
}
}
}
- মাল্টিডেক্স বিল্ডগুলির জন্য, আপনি এখন প্রোগার্ড নিয়মগুলি ব্যবহার করতে পারেন যা নির্ধারণ করতে Gradle আপনার অ্যাপের প্রধান DEX ফাইলে কম্পাইল করবে৷ যেহেতু অ্যান্ড্রয়েড সিস্টেম আপনার অ্যাপ শুরু করার সময় প্রথমে প্রধান DEX ফাইল লোড করে, তাই আপনি মূল DEX ফাইলে কম্পাইল করে স্টার্টআপের সময় নির্দিষ্ট ক্লাসগুলিকে অগ্রাধিকার দিতে পারেন৷ আপনি আপনার প্রধান DEX ফাইলের জন্য বিশেষভাবে একটি ProGuard কনফিগারেশন ফাইল তৈরি করার পরে,
buildTypes.multiDexKeepProguard
ব্যবহার করে Gradle-এ কনফিগারেশন ফাইলের পাথ পাস করুন। এই DSL ব্যবহার করা buildTypes.proguardFiles
ব্যবহার করার থেকে আলাদা, যা আপনার অ্যাপের জন্য সাধারণ ProGuard নিয়ম প্রদান করে এবং প্রধান DEX ফাইলের জন্য ক্লাস নির্দিষ্ট করে না। -
android:extractNativeLibs
ফ্ল্যাগের জন্য সমর্থন যোগ করে, যা আপনি একটি ডিভাইসে ইনস্টল করার সময় আপনার অ্যাপের আকার কমাতে পারে। আপনি যখন আপনার অ্যাপ ম্যানিফেস্টের <application>
উপাদানটিতে এই পতাকাটিকে false
সেট করেন, তখন গ্রেডল প্যাকেজগুলি আপনার APK এর সাথে আপনার নেটিভ লাইব্রেরিগুলির সংকুচিত এবং সারিবদ্ধ সংস্করণগুলিকে সেট করে। এটি ইনস্টলেশনের সময় PackageManager
আপনার নেটিভ লাইব্রেরিগুলিকে APK থেকে ডিভাইসের ফাইল সিস্টেমে অনুলিপি করতে বাধা দেয় এবং আপনার অ্যাপের ডেল্টা আপডেটগুলিকে ছোট করার অতিরিক্ত সুবিধা রয়েছে৷ - আপনি এখন পণ্যের স্বাদের জন্য
versionNameSuffix
এবং applicationIdSuffix
নির্দিষ্ট করতে পারেন। ( ইস্যু 59614 )
- পরিবর্তন:
-
getDefaultProguardFile
এখন ডিফল্ট ProGuard ফাইলগুলি ফেরত দেয় যা Gradle-এর জন্য Android প্লাগইন সরবরাহ করে এবং Android SDK-এ থাকা ফাইলগুলি আর ব্যবহার করে না৷ - উন্নত জ্যাক কম্পাইলার কর্মক্ষমতা এবং বৈশিষ্ট্য:
-
testCoverageEnabled
to true
সেট করার সময় জ্যাক এখন Jacoco পরীক্ষার কভারেজ সমর্থন করে। - টীকা প্রসেসরের জন্য উন্নত সমর্থন। আপনার ক্লাসপাথের টীকা প্রসেসর, যেমন কোনো
compile
নির্ভরতা, আপনার বিল্ডে স্বয়ংক্রিয়ভাবে প্রয়োগ করা হয়। আপনি আপনার মডিউল-স্তরের build.gradle
ফাইলে javaCompileOptions.annotationProcessorOptions {}
DSL ব্যবহার করে আপনার বিল্ড এবং পাস আর্গুমেন্টে একটি টীকা প্রসেসর নির্দিষ্ট করতে পারেন: গ্রোভি
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
className 'com.example.MyProcessor'
// Arguments are optional.
arguments = [ foo : 'bar' ]
}
}
}
}
কোটলিন
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
className = "com.example.MyProcessor"
// Arguments are optional.
arguments(mapOf(foo to "bar"))
}
}
}
}
আপনি যদি কম্পাইলের সময় একটি টীকা প্রসেসর প্রয়োগ করতে চান কিন্তু এটি আপনার APK-তে অন্তর্ভুক্ত না করেন, তাহলে annotationProcessor
নির্ভরতা সুযোগ ব্যবহার করুন:
গ্রোভি
dependencies {
compile 'com.google.dagger:dagger:2.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
// or use buildVariantAnnotationProcessor to target a specific build variant
}
কোটলিন
dependencies {
implementation("com.google.dagger:dagger:2.0")
annotationProcessor("com.google.dagger:dagger-compiler:2.0")
// or use buildVariantAnnotationProcessor to target a specific build variant
}
আপনি সেট করতে পারেন এমন প্যারামিটারগুলির একটি তালিকার জন্য, কমান্ড লাইন থেকে নিম্নলিখিতটি চালান:
java -jar /build-tools/jack.jar --help-properties
- ডিফল্টরূপে, গ্র্যাডল ডেমনের হিপ সাইজ কমপক্ষে 1.5 জিবি হলে, জ্যাক এখন গ্রেডলের মতো একই প্রক্রিয়ায় চলে। ডেমন হিপের আকার সামঞ্জস্য করতে, আপনার
gradle.properties
ফাইলে নিম্নলিখিত যোগ করুন:
# This sets the daemon heap size to 1.5GB.
org.gradle.jvmargs=-Xmx1536M
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["\u003cbr /\u003e\n\nAndroid Gradle Plugin 2.2.0 (September 2016)\n\nDependencies:\nNew:\n:\n - Uses Gradle 2.14.1, which includes performance improvements and new features, and fixes a security vulnerability that allows local privilege escalation when using the Gradle daemon. For more details, see the [Gradle release notes](https://docs.gradle.org/2.14.1/release-notes).\n - Using the [`externalNativeBuild {}`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.ExternalNativeBuild.html) DSL, Gradle now lets you link to your native sources and compile native libraries using CMake or ndk-build. After building your native libraries, Gradle packages them into your APK. To learn more about using CMake and ndk-build with Gradle, read [Add C and C++ Code to Your\n Project](/studio/projects/add-native-code).\n - When you [run a\n build from the command line](/studio/build/building-cmdline), Gradle now attempts to auto-download any missing SDK components or updates that your project depends on. To learn more, read [Auto-download\n missing packages with Gradle](/studio/intro/update#download-with-gradle).\n - A new experimental caching feature lets Gradle speed up build times by pre-dexing, storing, and reusing the pre-dexed versions of your libraries. To learn more about using this experimental feature, read the [Build\n Cache](/studio/build/build-cache) guide.\n - Improves build performance by adopting a new default packaging pipeline which handles zipping, signing, and [zipaligning](/studio/command-line/zipalign) in one task. You can revert to using the older packaging tools by adding `android.useOldPackaging=true` to your `gradle.properties` file. While using the new packaging tool, the `zipalignDebug` task is not available. However, you can create one yourself by calling the `createZipAlignTask(String taskName, File inputFile, File\n outputFile)` method.\n - APK signing now uses [APK Signature Scheme\n v2](/about/versions/nougat/android-7.0#apk_signature_v2) in addition to traditional JAR signing. All Android platforms accept the resulting APKs. Any modification to these APKs after signing invalidates their v2 signatures and prevents installation on a device. To disable this feature, add the following to your module-level `build.gradle` file: \n\n Groovy \n\n ```groovy\n android {\n ...\n signingConfigs {\n config {\n ...\n v2SigningEnabled false\n }\n }\n }\n \n ```\n\n Kotlin \n\n ```kotlin\n android {\n ...\n signingConfigs {\n create(\"config\") {\n ...\n v2SigningEnabled = false\n }\n }\n }\n \n ```\n - For multidex builds, you can now use ProGuard rules to determine which classes Gradle should compile into your app's *main* DEX file. Because the Android system loads the main DEX file first when starting your app, you can prioritize certain classes at startup by compiling them into the main DEX file. After you create a ProGuard configuration file specifically for your main DEX file, pass the configuration file's path to Gradle using [buildTypes.multiDexKeepProguard](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html#com.android.build.gradle.internal.dsl.BuildType:multiDexKeepProguard). Using this DSL is different from using [`buildTypes.proguardFiles`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html#com.android.build.gradle.internal.dsl.BuildType:proguardFiles(java.lang.Object[])), which provides general ProGuard rules for your app and does not specify classes for the main DEX file.\n - Adds support for the `android:extractNativeLibs` flag, which can reduce the size of your app when you install it on a device. When you set this flag to `false` in the [`\u003capplication\u003e`](/guide/topics/manifest/application-element) element of your app manifest, Gradle packages uncompressed and aligned versions of your native libraries with your APK. This prevents [`PackageManager`](/reference/android/content/pm/PackageManager) from copying out your native libraries from the APK to the device's file system during installation and has the added benefit of making delta updates of your app smaller.\n - You can now specify [`versionNameSuffix`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.ProductFlavor.html#com.android.build.gradle.internal.dsl.ProductFlavor:versionNameSuffix) and [`applicationIdSuffix`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.ProductFlavor.html#com.android.build.gradle.internal.dsl.ProductFlavor:applicationIdSuffix) for product flavors. ([Issue 59614](http://b.android.com/59614))\n\n\nChanges:\n:\n - `getDefaultProguardFile` now returns the default ProGuard files that Android plugin for Gradle provides and no longer uses the ones in the Android SDK.\n - Improved Jack compiler performance and features:\n - Jack now supports Jacoco test coverage when setting [testCoverageEnabled](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html#com.android.build.gradle.internal.dsl.BuildType:testCoverageEnabled) to `true`.\n - Improved support for annotation processors. Annotation processors on your classpath, such as any `compile` dependencies, are automatically applied to your build. You can also specify an annotation processor in your build and pass arguments by using the [`javaCompileOptions.annotationProcessorOptions {}`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.AnnotationProcessorOptions.html) DSL in your module-level `build.gradle` file: \n\n Groovy \n\n ```groovy\n android {\n ...\n defaultConfig {\n ...\n javaCompileOptions {\n annotationProcessorOptions {\n className 'com.example.MyProcessor'\n // Arguments are optional.\n arguments = [ foo : 'bar' ]\n }\n }\n }\n }\n \n ```\n\n Kotlin \n\n ```kotlin\n android {\n ...\n defaultConfig {\n ...\n javaCompileOptions {\n annotationProcessorOptions {\n className = \"com.example.MyProcessor\"\n // Arguments are optional.\n arguments(mapOf(foo to \"bar\"))\n }\n }\n }\n }\n \n ```\n\n\n If you want to apply an annotation processor at compile\n time but not include it in your APK, use the\n `annotationProcessor` dependency scope: \n\n Groovy \n\n ```groovy\n dependencies {\n compile 'com.google.dagger:dagger:2.0'\n annotationProcessor 'com.google.dagger:dagger-compiler:2.0'\n // or use buildVariantAnnotationProcessor to target a specific build variant\n }\n \n ```\n\n Kotlin \n\n ```kotlin\n dependencies {\n implementation(\"com.google.dagger:dagger:2.0\")\n annotationProcessor(\"com.google.dagger:dagger-compiler:2.0\")\n // or use buildVariantAnnotationProcessor to target a specific build variant\n }\n \n ```\n - For a list of parameters you can set, run the following from the command line: \n\n ```\n java -jar /build-tools/jack.jar --help-properties\n ```\n - By default, if the Gradle daemon's heap size is at least 1.5 GB, Jack now runs in the same process as Gradle. To adjust the daemon heap size, add the following to your `gradle.properties` file:\n\n \u003cbr /\u003e\n\n ```\n # This sets the daemon heap size to 1.5GB.\n org.gradle.jvmargs=-Xmx1536M\n ```\n\n \u003cbr /\u003e\n\n\n\u003cbr /\u003e"]]