در زیر یادداشتهای انتشار اندروید استودیو نسخه 3.6 و پایینتر و افزونه Android Gradle نسخه 3.6.0 و پایینتر آمده است.
نسخه های قدیمی اندروید استودیو
3.6 (فوریه 2020)
اندروید استودیو 3.6 یک نسخه اصلی است که شامل انواع ویژگیها و بهبودهای جدید است.
ما همچنین میخواهیم از همه مشارکتکنندگان انجمن خود که در این نسخه کمک کردهاند تشکر کنیم.
3.6.3 (آوریل 2020)
این به روز رسانی جزئی شامل رفع اشکال مختلف است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.6.2 (مارس 2020)
این به روز رسانی جزئی شامل رفع اشکال مختلف است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.6.1 (فوریه 2020)
این به روز رسانی جزئی شامل رفع اشکال مختلف است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
ابزار طراحی
این نسخه از Android Studio شامل بهروزرسانیهایی برای چندین ابزار طراحی، از جمله Layout Editor و Resource Manager است.
تقسیم نمایش و زوم در ویرایشگرهای طراحی
به روز رسانی های زیر برای ویرایشگرهای طراحی بصری در این نسخه گنجانده شده است:
ویرایشگرهای طراحی مانند Layout Editor و Navigation Editor اکنون یک نمای تقسیم را ارائه می دهند که به شما امکان می دهد هر دو نمای طراحی و کد رابط کاربری خود را به طور همزمان مشاهده کنید. در گوشه سمت راست بالای پنجره ویرایشگر، اکنون سه دکمه وجود دارد
برای جابجایی بین گزینه های مشاهده:
- برای فعال کردن نمای تقسیم، روی نماد تقسیم کلیک کنید
.
- برای فعال کردن نمای منبع XML، روی نماد منبع کلیک کنید
.
- برای فعال کردن نمای طراحی، روی نماد طراحی کلیک کنید
.
- برای فعال کردن نمای تقسیم، روی نماد تقسیم کلیک کنید
کنترلهای بزرگنمایی و حرکت در ویرایشگرهای طراحی به یک پانل شناور در گوشه سمت راست پایین پنجره ویرایشگر منتقل شدهاند.
برای کسب اطلاعات بیشتر، به ساخت رابط کاربری با ویرایشگر طرحبندی مراجعه کنید.
برگه منبع انتخابگر رنگ
برای کمک به شما در بهروزرسانی سریع مقادیر منابع رنگی در برنامه خود هنگام استفاده از انتخابگر رنگ در XML یا ابزارهای طراحی، اکنون IDE مقادیر منابع رنگ را برای شما پر میکند.
مدیر منابع
مدیر منابع شامل به روز رسانی های زیر است:
- مدیر منابع اکنون از اکثر انواع منابع پشتیبانی می کند.
- هنگام جستجوی یک منبع، مدیر منابع اکنون نتایج همه ماژول های پروژه را نمایش می دهد. قبلاً، جستجوها فقط از ماژول انتخاب شده نتیجه میدادند.
- دکمه فیلتر به شما امکان می دهد منابع را از ماژول های وابسته محلی، کتابخانه های خارجی و چارچوب اندروید مشاهده کنید. همچنین می توانید از فیلتر برای نشان دادن ویژگی های تم استفاده کنید.
- اکنون می توانید با کلیک کردن در کادر متنی بالای منبع، نام منابع را در طی فرآیند واردات تغییر دهید.
برای کسب اطلاعات بیشتر، به مدیریت منابع رابط کاربری برنامه خود با مدیریت منابع مراجعه کنید.
به روز رسانی پلاگین Android Gradle
آخرین نسخه پلاگین Android Gradle شامل به روز رسانی های زیادی از جمله بهینه سازی برای سرعت ساخت، پشتیبانی از افزونه انتشار Maven و پشتیبانی از View Binding است. برای کسب اطلاعات بیشتر، یادداشتهای انتشار کامل را بخوانید.
مشاهده صحافی
View binding به شما این امکان را می دهد که با ایجاد یک کلاس binding برای هر فایل طرح بندی XML، کدی را راحت تر بنویسید که با نماها تعامل دارد. این کلاس ها حاوی ارجاع مستقیم به تمام نماهایی هستند که دارای شناسه در طرح مربوطه هستند.
از آنجایی که جایگزین findViewById()
می شود، view binding خطر استثناهای اشاره گر تهی ناشی از شناسه view نامعتبر را از بین می برد.
برای فعال کردن view binding، باید از افزونه Android Gradle نسخه 3.6.0 یا بالاتر استفاده کنید و موارد زیر را در فایل build.gradle
هر ماژول قرار دهید:
شیار
android { buildFeatures.viewBinding = true }
کاتلین
android { buildFeatures.viewBinding = true }
اعمال تغییرات
اکنون می توانید یک کلاس اضافه کنید و سپس با کلیک روی Apply Code Changes یا Apply Changes and Restart Activity، آن تغییر کد را در برنامه در حال اجرا خود اجرا کنید.
برای کسب اطلاعات بیشتر در مورد تفاوت بین این دو عمل، به اعمال تغییرات مراجعه کنید.
گزینه منوی Refactor برای فعال کردن پشتیبانی از برنامه های فوری
اکنون می توانید ماژول پایه خود را در هر زمانی پس از ایجاد پروژه برنامه خود به صورت زیر فعال کنید:
- با انتخاب View > Tool Windows > Project از نوار منو، پنل Project را باز کنید.
- روی ماژول پایه خود، که معمولاً «برنامه» نام دارد، راست کلیک کرده و Refactor > Enable Instant Apps Support را انتخاب کنید.
- در گفتگوی ظاهر شده، ماژول پایه خود را از منوی کشویی انتخاب کنید.
- روی OK کلیک کنید.
توجه: گزینه فعال کردن فوری ماژول برنامه پایه شما از جادوگر ایجاد پروژه جدید حذف شده است.
برای کسب اطلاعات بیشتر، نمای کلی Google Play Instant را بخوانید.
کد بایت کلاس و متد را در APK Analyzer حذف کنید
هنگام استفاده از APK Analyzer برای بازرسی فایلهای DEX، میتوانید بایت کد کلاس و متد را به صورت زیر حذف کنید:
- Build > Analyze APK را از نوار منو انتخاب کنید.
- در گفتگوی ظاهر شده، به APK مورد نظر برای بازرسی بروید و آن را انتخاب کنید.
- روی Open کلیک کنید.
- در APK Analyzer، فایل DEX را که می خواهید بررسی کنید، انتخاب کنید.
- در نمایشگر فایل DEX، فایل نگاشت ProGuard را برای APK که در حال تجزیه و تحلیل هستید بارگیری کنید .
- روی کلاس یا روشی که می خواهید بررسی کنید کلیک راست کرده و Show bytecode را انتخاب کنید.
ابزار بومی
بهروزرسانیهای زیر از توسعه بومی (C/C++) در Android Studio پشتیبانی میکنند.
پشتیبانی کاتلین
ویژگیهای NDK زیر در Android Studio که قبلاً در جاوا پشتیبانی میشد، اکنون در Kotlin نیز پشتیبانی میشوند:
از یک اعلان JNI به تابع پیاده سازی مربوطه در C/C++ بروید. این نگاشت را با نگه داشتن نشانگر مورد C یا C++ در نزدیکی شماره خط در فایل کد منبع مدیریت شده مشاهده کنید.
به طور خودکار یک تابع اجرای خرد برای یک اعلان JNI ایجاد کنید. ابتدا اعلان JNI را تعریف کنید و سپس “jni” یا نام متد را در فایل C/C++ تایپ کنید تا فعال شود.
توابع پیاده سازی بومی استفاده نشده به عنوان یک هشدار در کد منبع برجسته می شوند. اعلانهای JNI با اجراهای از دست رفته نیز بهعنوان یک خطا برجسته میشوند.
هنگامی که یک تابع پیاده سازی بومی را تغییر نام می دهید، تمام اعلان های JNI مربوطه به روز می شوند. تغییر نام یک اعلان JNI برای به روز رسانی تابع پیاده سازی بومی.
بررسی امضا برای پیاده سازی های JNI به صورت ضمنی.
سایر بهبودهای JNI
ویرایشگر کد در اندروید استودیو اکنون از یک گردش کار توسعه یکپارچهتر JNI، از جمله راهنماییهای نوع بهبودیافته، تکمیل خودکار، بازرسیها و بازسازی کد پشتیبانی میکند.
بارگیری مجدد APK برای کتابخانه های بومی {:#3.6-reload-apk}
هنگامی که APK در پروژه شما خارج از IDE به روز می شود، دیگر نیازی به ایجاد یک پروژه جدید ندارید. Android Studio تغییرات را در APK تشخیص می دهد و به شما امکان می دهد آن را دوباره وارد کنید.
منابع APK فقط کاتلین را ضمیمه کنید
اکنون میتوانید هنگام نمایهسازی و اشکالزدایی فایلهای APK از پیش ساخته شده، منابع APK خارجی فقط برای Kotlin را پیوست کنید. برای کسب اطلاعات بیشتر، به پیوست منابع Kotlin/Java مراجعه کنید.
تشخیص نشت در Memory Profiler
هنگام تجزیه و تحلیل heap dump در Memory Profiler، اکنون میتوانید دادههای نمایهای را فیلتر کنید که Android Studio فکر میکند ممکن است نشان دهنده نشت حافظه برای نمونههای Activity
و Fragment
در برنامه شما باشد.
انواع داده هایی که فیلتر نشان می دهد شامل موارد زیر است:
- نمونههای
Activity
که از بین رفتهاند اما هنوز به آنها ارجاع داده میشود. - نمونه های
Fragment
کهFragmentManager
معتبری ندارند اما همچنان به آنها ارجاع داده می شود.
منابع APK فقط کاتلین را ضمیمه کنید
اکنون میتوانید هنگام نمایهسازی و اشکالزدایی فایلهای APK از پیش ساخته شده، منابع APK خارجی فقط برای Kotlin را پیوست کنید. برای کسب اطلاعات بیشتر، به پیوست منابع Kotlin/Java مراجعه کنید.
تشخیص نشت در Memory Profiler
هنگام تجزیه و تحلیل heap dump در Memory Profiler، اکنون میتوانید دادههای نمایهای را فیلتر کنید که Android Studio فکر میکند ممکن است نشان دهنده نشت حافظه برای نمونههای Activity
و Fragment
در برنامه شما باشد.
انواع داده هایی که فیلتر نشان می دهد شامل موارد زیر است:
- نمونههای
Activity
که از بین رفتهاند اما هنوز به آنها ارجاع داده میشود. - نمونه های
Fragment
کهFragmentManager
معتبری ندارند اما همچنان به آنها ارجاع داده می شود.
در شرایط خاص، مانند موارد زیر، فیلتر ممکن است مثبت کاذب باشد:
- یک
Fragment
ایجاد شده است اما هنوز استفاده نشده است. - یک
Fragment
در حافظه پنهان ذخیره می شود، اما نه به عنوان بخشی از یکFragmentTransaction
.
برای استفاده از این ویژگی، ابتدا یک فایل heap dump بگیرید یا یک فایل heap dump را به Android Studio وارد کنید . برای نمایش بخشها و فعالیتهایی که ممکن است حافظه را نشت کند، کادر بررسی Activity/Fragment Leaks را در قسمت heap dump panel Memory Profiler انتخاب کنید.
فیلتر کردن یک پشته برای نشت حافظه.
شبیه سازها
Android Studio 3.6 به شما کمک می کند از چندین به روز رسانی موجود در Android Emulator نسخه 29.2.7 و بالاتر استفاده کنید، همانطور که در زیر توضیح داده شده است.
پشتیبانی موقعیت مکانی بهبود یافته
شبیه ساز اندروید 29.2.7 و بالاتر پشتیبانی بیشتری برای شبیه سازی مختصات GPS و اطلاعات مسیر ارائه می دهد. هنگامی که کنترلهای Emulators Extended را باز میکنید، گزینههای موجود در برگه مکان اکنون در دو برگه سازماندهی میشوند: نقاط منفرد و مسیرها .
تک امتیاز
در تب Single points ، میتوانید از نمای وب Google Maps برای جستجوی نقاط مورد علاقه استفاده کنید، درست مانند زمانی که از Google Maps در تلفن یا مرورگر استفاده میکنید. وقتی مکانی را در نقشه جستجو میکنید یا روی آن کلیک میکنید، میتوانید با انتخاب نقطه ذخیره در نزدیکی پایین نقشه، مکان را ذخیره کنید. همه مکانهای ذخیره شده شما در سمت راست پنجره Extended Controls فهرست شدهاند.
برای تنظیم مکان شبیهسازها به مکانی که روی نقشه انتخاب کردهاید، روی دکمه تنظیم مکان نزدیک سمت راست پایین پنجره Extended Controls کلیک کنید.
.
مسیرها
مانند برگه Single Point ، تب Routes نمای وب Google Maps را ارائه می دهد که می توانید از آن برای ایجاد یک مسیر بین دو یا چند مکان استفاده کنید. برای ایجاد و ذخیره مسیر، موارد زیر را انجام دهید:
- در نمای نقشه، از قسمت متن برای جستجوی اولین مقصد در مسیر خود استفاده کنید.
- مکان را از نتایج جستجو انتخاب کنید.
- دکمه Navigate را انتخاب کنید.
- نقطه شروع مسیر خود را از روی نقشه انتخاب کنید.
- (اختیاری) برای افزودن توقف های اضافی به مسیر خود، روی افزودن مقصد کلیک کنید.
- با کلیک روی ذخیره مسیر در نمای نقشه، مسیر خود را ذخیره کنید.
- یک نام برای مسیر مشخص کنید و روی ذخیره کلیک کنید.
برای شبیه سازی شبیه ساز به دنبال مسیری که ذخیره کرده اید، مسیر را از لیست مسیرهای ذخیره شده انتخاب کنید و روی Play route در پایین سمت راست پنجره Extended Controls کلیک کنید. برای توقف شبیهسازی، روی توقف مسیر کلیک کنید.
.
برای شبیه سازی مداوم شبیه ساز در مسیر مشخص شده، سوئیچ کنار تکرار پخش را فعال کنید. برای تغییر سرعت حرکت شبیه ساز از مسیر مشخص شده، گزینه ای را از منوی بازشوی سرعت پخش انتخاب کنید.
پشتیبانی از چند نمایشگر
شبیهساز اندروید اکنون به شما امکان میدهد برنامه خود را روی چندین نمایشگر مستقر کنید، که از ابعاد قابل تنظیم پشتیبانی میکنند و میتوانند به شما در آزمایش برنامههایی که از چند پنجره و چند نمایشگر پشتیبانی میکنند کمک کند. هنگامی که یک دستگاه مجازی در حال اجرا است، می توانید حداکثر دو نمایشگر اضافی به شرح زیر اضافه کنید:
کنترل های Extended را باز کنید و به تب Displays بروید.
با کلیک کردن روی افزودن نمایشگر ثانویه، یک نمایشگر دیگر اضافه کنید.
از منوی کشویی زیر نمایشگرهای ثانویه ، یکی از موارد زیر را انجام دهید:
یکی از نسبت های تصویر از پیش تعیین شده را انتخاب کنید
سفارشی را انتخاب کنید و ارتفاع ، عرض و dpi را برای نمایش سفارشی خود تنظیم کنید.
(اختیاری) برای افزودن نمایشگر سوم روی Add secondary display کلیک کنید.
برای افزودن نمایشگر(های) مشخص شده به دستگاه مجازی در حال اجرا، روی اعمال تغییرات کلیک کنید.
دستگاه های مجازی جدید و الگوهای پروژه برای سیستم عامل Android Automotive
هنگامی که یک پروژه جدید با استفاده از Android Studio ایجاد میکنید، اکنون میتوانید از میان سه الگو از برگه Automotive در جادوگر ایجاد پروژه جدید انتخاب کنید: بدون فعالیت ، سرویس رسانه و سرویس پیامرسانی . برای پروژههای موجود، میتوانید با انتخاب File > New > New Module از نوار منو و انتخاب Automotive Module ، پشتیبانی از دستگاههای Android Automotive را اضافه کنید. سپس جادوگر Create New Module شما را از طریق ایجاد یک ماژول جدید با استفاده از یکی از الگوهای پروژه Android Automotive راهنمایی می کند.
.
علاوه بر این، اکنون می توانید با انتخاب یکی از گزینه های زیر در برگه Automotive در جادوگر پیکربندی دستگاه مجازی، یک دستگاه مجازی Android (AVD) برای دستگاه های دارای سیستم عامل Android Automotive ایجاد کنید .
- Polestar 2 : یک AVD ایجاد کنید که واحد اصلی Polestar 2 را شبیه سازی کند.
- Automotive (منظره 1024p) : یک AVD برای واحدهای اصلی Android Automotive با ابعاد 1024 x 768 پیکسل ایجاد کنید.
.
دانلودهای SDK قابل ازسرگیری
هنگام دانلود مؤلفهها و ابزارهای SDK با استفاده از مدیر SDK، Android Studio اکنون به شما امکان میدهد بهجای راهاندازی مجدد دانلود از ابتدا، بارگیریهایی را که قطع شدهاند (مثلاً به دلیل مشکل شبکه) از سر بگیرید. این بهبود به ویژه برای دانلودهای بزرگ، مانند شبیه ساز اندروید یا تصاویر سیستم، زمانی که اتصال به اینترنت قابل اعتماد نیست، مفید است.
علاوه بر این، اگر یک کار دانلود SDK در پسزمینه اجرا میشود، اکنون میتوانید با استفاده از کنترلهای نوار وضعیت، دانلود را متوقف یا از سر بگیرید.
یک کار دانلود پسزمینه در نوار وضعیت با کنترلهای جدید که به شما امکان میدهد دانلود را متوقف یا از سر بگیرید.
Win32 منسوخ شد
نسخه ویندوز 32 بیتی اندروید استودیو پس از دسامبر 2019 دیگر به روز رسانی دریافت نمی کند و پس از دسامبر 2020 دیگر پشتیبانی نخواهد شد. می توانید به استفاده از Android Studio ادامه دهید. با این حال، برای دریافت بهروزرسانیهای اضافی، ایستگاه کاری خود را به نسخه 64 بیتی ویندوز ارتقا دهید.
برای کسب اطلاعات بیشتر، وبلاگ استهلاک 32 بیتی ویندوز را مطالعه کنید
گزینه جدید برای بهینه سازی زمان همگام سازی Gradle
در نسخه های قبلی، اندروید استودیو لیستی از تمام وظایف Gradle را در حین همگام سازی Gradle بازیابی کرد. برای پروژه های بزرگ، بازیابی لیست وظایف می تواند باعث کندی زمان همگام سازی شود.
برای بهبود عملکرد Gradle Sync، به File > Settings > Experimental بروید و در حین همگام سازی Gradle لیست وظایف Gradle را ایجاد نکنید را انتخاب کنید.
هنگامی که این گزینه را فعال میکنید، Android Studio از ساخت لیست وظایف در حین همگامسازی صرفنظر میکند، که به Gradle Sync اجازه میدهد سریعتر کامل شود و پاسخگویی UI را بهبود میبخشد. به خاطر داشته باشید که وقتی IDE از ساخت لیست وظایف صرفنظر می کند، لیست وظایف در پانل Gradle خالی است و تکمیل خودکار نام کار در فایل های ساخت کار نمی کند.
مکان جدید برای تغییر حالت آفلاین Gradle
برای فعال یا غیرفعال کردن حالت آفلاین Gradle، ابتدا View > Tool Windows > Gradle را از نوار منو انتخاب کنید. سپس، در نزدیکی بالای پنجره Gradle ، روی Toggle Offline Mode کلیک کنید .
IntelliJ IDEA 2019.2
هسته Android Studio IDE با بهبودهایی از IntelliJ IDEA تا نسخه 2019.2 به روز شده است.
برای کسب اطلاعات بیشتر در مورد بهبودهای سایر نسخه های IntelliJ که به صورت تجمعی با نسخه 2019.2 گنجانده شده اند، به صفحات زیر مراجعه کنید:
مشارکت کنندگان جامعه
از همه مشارکت کنندگان انجمن ما که به ما در کشف اشکالات و راه های دیگر برای بهبود Android Studio 3.6 کمک کردند، سپاسگزاریم. به ویژه، مایلیم از افراد زیر که اشکالات را گزارش کردند تشکر کنیم:
3.5 (اوت 2019)
اندروید استودیو 3.5 نسخه اصلی و نتیجه پروژه Marble است. با شروع انتشار Android Studio 3.3 ، ابتکار Project Marble چندین نسخه را در بر گرفت که بر بهبود سه حوزه اصلی IDE تمرکز دارد: سلامت سیستم ، پرداخت ویژگی ها ، و رفع اشکال.
برای کسب اطلاعات درباره این و سایر بهروزرسانیهای Project Marble، پست وبلاگ Android Developers یا بخشهای زیر را بخوانید.
همچنین میخواهیم از همه مشارکتکنندگان انجمن خود که در این نسخه کمک کردهاند تشکر کنیم.
3.5.3 (دسامبر 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است.
3.5.2 (نوامبر 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.5.1 (اکتبر 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
پروژه مرمر: سلامت سیستم
در این بخش تغییرات Android Studio 3.5 که بر روی بهبود سلامت سیستم متمرکز شده است، توضیح می دهد.
تنظیمات حافظه توصیه شده
Android Studio اکنون به شما اطلاع میدهد که اگر تشخیص دهد میتوانید با افزایش حداکثر مقدار RAM که سیستمعامل شما باید برای پردازشهای Android Studio تخصیص دهد، مانند هسته IDE، Daemon Gradle و Daemon Kotlin، عملکرد را بهبود بخشد، به شما اطلاع میدهد. میتوانید با کلیک کردن روی پیوند عمل در اعلان، تنظیمات توصیهشده را بپذیرید، یا میتوانید با انتخاب File > Settings (یا Android Studio > Preferences در macOS)، و سپس یافتن بخش تنظیمات حافظه در قسمت Appearance & Behavior > System Settings، این تنظیمات را به صورت دستی تنظیم کنید. برای کسب اطلاعات بیشتر، به حداکثر اندازه پشته مراجعه کنید.
یک اعلان در مورد تنظیمات حافظه توصیه شده.
گزارش استفاده از حافظه
گاهی اوقات بازتولید و گزارش مشکلات حافظه در Android Studio دشوار است. برای کمک به حل این مشکل، Android Studio به شما امکان میدهد با کلیک کردن روی Help > Analyze Memory Usage از نوار منو، گزارش استفاده از حافظه را ایجاد کنید. وقتی این کار را انجام میدهید، IDE قبل از اینکه بپرسد میخواهید آنها را به تیم Android Studio ارسال کنید تا به شناسایی منبع مشکلات حافظه کمک کند، دادهها را به صورت محلی پاکسازی میکند. برای کسب اطلاعات بیشتر، به اجرای گزارش استفاده از حافظه مراجعه کنید.
گزارش استفاده از حافظه
ویندوز: بهینه سازی ورودی/خروجی فایل آنتی ویروس
Android Studio اکنون به طور خودکار بررسی می کند که آیا فهرست های پروژه خاصی از اسکن آنتی ویروس بلادرنگ حذف شده اند یا خیر. هنگامی که میتوان تنظیماتی را برای بهبود عملکرد ساخت انجام داد، Android Studio به شما اطلاع میدهد و دستورالعملهایی را درباره نحوه بهینهسازی پیکربندی آنتیویروس ارائه میدهد. برای کسب اطلاعات بیشتر، به به حداقل رساندن تأثیر نرم افزار آنتی ویروس بر سرعت ساخت مراجعه کنید.
پروژه مرمر: پولیش ویژگی
این بخش تغییرات اندروید استودیو 3.5 را که بر روی بهبود ویژگی های موجود متمرکز است، توضیح می دهد.
اعمال تغییرات
Apply Changes به شما امکان میدهد تغییرات کد و منابع را بدون راهاندازی مجدد برنامه و در برخی موارد بدون راهاندازی مجدد فعالیت فعلی، به برنامه در حال اجرا خود فشار دهید. Apply Changes یک رویکرد کاملاً جدید را برای حفظ وضعیت برنامه شما پیاده سازی می کند. برخلاف Instant Run که بایت کد APK شما را بازنویسی میکند، Apply Changes با استفاده از ابزار دقیق زمان اجرا که در Android 8.0 (سطح API 26) یا بالاتر پشتیبانی میشود، کلاسها را در لحظه بازتعریف میکند.
برای کسب اطلاعات بیشتر، به اعمال تغییرات مراجعه کنید.
دکمه های نوار ابزار برای اعمال تغییرات.
جریان استقرار برنامه
IDE یک منوی کشویی جدید دارد که به شما امکان می دهد به سرعت انتخاب کنید که می خواهید برنامه خود را در کدام دستگاه مستقر کنید. این منو همچنین شامل یک گزینه جدید است که به شما امکان می دهد برنامه خود را همزمان روی چندین دستگاه اجرا کنید.
منوی کشویی دستگاه مورد نظر.
همگام سازی Gradle و تشخیص کش بهبود یافته است
اکنون IDE بهتر تشخیص می دهد که Gradle به طور دوره ای کش ساخت شما را هنگام کاهش مصرف هارد دیسک پاک می کند. در نسخه های قبلی، این حالت باعث می شد که IDE وابستگی های از دست رفته را گزارش کند و همگام سازی Gradle با شکست مواجه شود. اکنون، IDE به سادگی وابستگی ها را در صورت نیاز دانلود می کند تا اطمینان حاصل شود که همگام سازی Gradle با موفقیت کامل می شود.
خروجی خطای ساخت بهبود یافته است
ساخت اکنون پنجره گزارش خطای بهتری مانند پیوند به فایل و خط خطای گزارش شده را برای فرآیندهای ساخت زیر ارائه می دهد:
- گردآوری و پیوند AAPT
- R8 و ProGuard
- دکسینگ
- ادغام منابع
- تجزیه فایل XML
- کامپایل Javac، Kotlinc و CMake
ارتقاء پروژه
تجربه بهروزرسانی بهبود یافته برای ارائه اطلاعات و اقدامات بیشتر برای کمک به شما در بهروزرسانی IDE و افزونه Android Gradle. برای مثال، خطاهای همگامسازی و ساخت بیشتر شامل اقداماتی است که به شما در کاهش خطاها هنگام بهروزرسانی کمک میکند.
مهم است که به خاطر داشته باشید، شما می توانید IDE را مستقل از سایر مؤلفه ها، مانند افزونه Android Gradle، به روز کنید. بنابراین، میتوانید با خیال راحت IDE را بهمحض عرضه نسخه جدیدتر بهروزرسانی کنید و بعداً سایر مؤلفهها را بهروزرسانی کنید.
ویرایشگر چیدمان
Android Studio 3.5 شامل چندین پیشرفت برای تجسم، مدیریت و تعامل است.
هنگام کار با ConstraintLayout
، یک بخش Constraints جدید در پانل Attributes ، روابط محدودیتهای مؤلفه UI انتخاب شده را فهرست میکند. شما می توانید یک محدودیت را از سطح طراحی یا از لیست محدودیت ها برای برجسته کردن محدودیت در هر دو ناحیه انتخاب کنید.
روابط محدودیت برای یک عنصر UI انتخاب شده.
به همین ترتیب، اکنون می توانید یک محدودیت را با انتخاب آن و فشار دادن کلید Delete
حذف کنید. همچنین می توانید با نگه داشتن کلید Control
( Command
در macOS) و کلیک بر روی لنگر محدودیت، یک محدودیت را حذف کنید. توجه داشته باشید که وقتی کلید Control
یا Command
را نگه میدارید و ماوس را روی یک لنگر نگه میدارید، هر گونه محدودیت مرتبط قرمز میشود تا نشان دهد که میتوانید برای حذف آنها کلیک کنید.
هنگامی که یک View انتخاب می شود، می توانید با کلیک بر روی هر یک از نمادهای + در قسمت Constraint Widget پانل Attributes ، یک محدودیت ایجاد کنید، همانطور که در تصویر زیر نشان داده شده است. هنگامی که یک محدودیت جدید ایجاد می کنید، ویرایشگر طرح بندی اکنون محدودیت را انتخاب و برجسته می کند، و بازخورد بصری فوری برای آنچه که اضافه کرده اید ارائه می دهد.
استفاده از ویجت محدودیت برای ایجاد محدودیت.
هنگام ایجاد یک محدودیت، ویرایشگر Layout اکنون فقط نقاط لنگر واجد شرایطی را نشان می دهد که می توانید آنها را محدود کنید. قبلاً، Layout Editor تمام نقاط لنگر را در همه نماها برجسته می کرد، صرف نظر از اینکه آیا می توانید آنها را محدود کنید یا خیر. علاوه بر این، یک پوشش آبی اکنون هدف محدودیت را برجسته می کند. این برجسته سازی به ویژه در هنگام تلاش برای محدود کردن مؤلفه ای که با مؤلفه دیگری همپوشانی دارد مفید است.
ایجاد یک محدودیت برای یک مؤلفه همپوشانی در Android Studio 3.4.
ایجاد یک محدودیت برای یک مؤلفه همپوشانی در Android Studio 3.5.
علاوه بر بهروزرسانیهای بالا، اندروید استودیو 3.5 شامل بهبودهای ویرایشگر طرحبندی زیر نیز میشود:
- ابزارک محدودیت و کشویی حاشیه پیشفرض اکنون به شما امکان میدهد از منابع ابعاد برای حاشیهها استفاده کنید.
- در نوار ابزار Layout Editor، لیست دستگاه هایی که اندازه سطح طراحی را تعیین می کنند، به روز شده است. علاوه بر این، رفتار چفت شدن هنگام تغییر اندازه بهبود یافته است و دستگیره های تغییر اندازه روی سطح طراحی اکنون همیشه قابل مشاهده هستند. هنگام تغییر اندازه، پوششهای جدیدی ظاهر میشوند که اندازههای رایج دستگاه را نشان میدهند.
- Layout Editor دارای یک طرح رنگ جدید است که سازگاری را بهبود می بخشد و کنتراست بین اجزا، متن و محدودیت ها را کاهش می دهد.
- حالت Blueprint اکنون شامل پشتیبانی متنی برای برخی از مؤلفههایی است که متن نشان داده نمیشود.
برای اطلاعات بیشتر درباره این تغییرات، به Android Studio Project Marble: Layout Editor مراجعه کنید.
اتصال داده ها
علاوه بر افزودن پشتیبانی از پردازش حاشیه نویسی افزایشی برای Data Binding، IDE ویژگی ها و عملکرد ویرایشگر هوشمند را هنگام ایجاد عبارات اتصال داده در XML بهبود می بخشد.
عملکرد ویرایشگر کد در Android Studio 3.4.

بهبود عملکرد ویرایش کد در Android Studio 3.5.
پشتیبانی بهبود یافته برای پروژه های C/C++
Android Studio 3.5 شامل چندین تغییر است که پشتیبانی از پروژه های C/C++ را بهبود می بخشد.
تغییرات پانل ساخت برای همگام سازی تک نسخه
اکنون می توانید هر دو نوع ساخت فعال و ABI فعال را در پنل Build Variants مشخص کنید. این ویژگی پیکربندی ساخت در هر ماژول را ساده می کند و همچنین می تواند عملکرد همگام سازی Gradle را بهبود بخشد.
برای کسب اطلاعات بیشتر، به تغییر نوع ساخت مراجعه کنید.
پانل Build Variants با انتخاب تک نوع توسط ABI.
نسخه های جانبی NDK
اکنون می توانید از چندین نسخه NDK در کنار هم استفاده کنید. این ویژگی هنگام پیکربندی پروژههایتان انعطافپذیری بیشتری به شما میدهد - برای مثال، اگر پروژههایی دارید که از نسخههای مختلف NDK در یک دستگاه استفاده میکنند.
اگر پروژه شما از پلاگین Android Gradle نسخه 3.5.0 یا بالاتر استفاده می کند، می توانید نسخه NDK را که هر ماژول در پروژه شما باید از آن استفاده کند را نیز مشخص کنید. میتوانید از این ویژگی برای ایجاد ساختهای قابل تکرار و کاهش ناسازگاریهای بین نسخههای NDK و افزونه Android Gradle استفاده کنید.
برای کسب اطلاعات بیشتر، به نصب و پیکربندی NDK، CMake و LLDB مراجعه کنید.
پشتیبانی ChromeOS
Android Studio اکنون به طور رسمی از دستگاههای ChromeOS پشتیبانی میکند، مانند HP Chromebook x360 14، Acer Chromebook 13/Spin 13، و موارد دیگر که میتوانید در مورد نیازهای سیستم بخوانید. برای شروع، Android Studio را در دستگاه ChromeOS سازگار خود دانلود کنید و دستورالعملهای نصب را دنبال کنید.
توجه: Android Studio در ChromeOS در حال حاضر از استقرار برنامه شما فقط در یک دستگاه سخت افزاری متصل پشتیبانی می کند. برای کسب اطلاعات بیشتر، اجرای برنامهها در دستگاه سختافزاری را بخوانید.
تحویل مشروط برای ماژول های ویژگی
تحویل مشروط به شما امکان میدهد الزامات پیکربندی دستگاه خاصی را برای ماژولهای ویژگی تنظیم کنید تا در حین نصب برنامه بهطور خودکار دانلود شوند. برای مثال، میتوانید یک ماژول ویژگی را پیکربندی کنید که شامل قابلیتهایی برای واقعیت افزوده (AR) باشد تا در نصب برنامه فقط برای دستگاههایی که AR را پشتیبانی میکنند در دسترس باشد.
این مکانیسم تحویل در حال حاضر از کنترل دانلود یک ماژول در زمان نصب برنامه بر اساس پیکربندیهای دستگاه زیر پشتیبانی میکند:
- ویژگی های سخت افزاری و نرم افزاری دستگاه، از جمله نسخه OpenGL ES
- کشور کاربر
- سطح API
اگر دستگاهی همه الزاماتی را که مشخص کردهاید برآورده نمیکند، ماژول در زمان نصب برنامه دانلود نمیشود. با این حال، ممکن است برنامه شما بعداً درخواست کند که ماژول را در صورت درخواست با استفاده از کتابخانه هسته Play دانلود کند . برای کسب اطلاعات بیشتر، پیکربندی تحویل مشروط را بخوانید.
IntelliJ IDEA 2019.1
هسته Android Studio IDE با پیشرفت هایی از IntelliJ IDEA تا نسخه 2019.1 ، مانند سفارشی سازی تم، به روز شده است.
آخرین نسخه IntelliJ که همراه اندروید استودیو قرار گرفت 2018.3.4 بود. برای اطلاعات بیشتر در مورد پیشرفتهای سایر نسخههای IntelliJ که به صورت تجمعی در این نسخه از Android Studio گنجانده شدهاند، بهروزرسانیهای رفع اشکال زیر را ببینید:
- IntelliJ IDEA 2018.3.6 {: .external-link}
- IntelliJ IDEA 2018.3.5 {: .external-link}
به روز رسانی پلاگین Android Gradle 3.5.0
برای کسب اطلاعات در مورد آنچه در افزونه Android Gradle نسخه 3.5.0 جدید است، مانند پشتیبانی بهبودیافته برای پردازش حاشیه نویسی افزایشی و تستهای واحد ذخیرهسازی، به یادداشتهای انتشار آن مراجعه کنید.
مشارکت کنندگان جامعه
از همه مشارکت کنندگان انجمن ما که به ما در کشف اشکالات و راه های دیگر برای بهبود Android Studio 3.5 کمک کردند، سپاسگزاریم. به ویژه، مایلیم از افراد زیر که اشکالات P0 و P1 را گزارش کردند تشکر کنیم:
|
|
|
3.4 (آوریل 2019)
اندروید استودیو 3.4 یک نسخه اصلی است که شامل انواع ویژگیها و بهبودهای جدید است.
3.4.2 (ژوئیه 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.4.1 (مه 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.4.0 مسائل شناخته شده
هنگام استقرار برنامه شما روی دستگاهی که Android Q بتا دارد، پروفایل کردن غیرفعال است.
- هنگام استفاده از Data Binding Library،
LiveDataListener.onChanged()
ممکن است با NPE شکست بخورد. یک راه حل برای این مشکل در Android Studio 3.4.1 گنجانده شده است و در حال حاضر در آخرین نسخه پیش نمایش Android Studio 3.5 موجود است. (به شماره 122066788 مراجعه کنید)
IntelliJ IDEA 2018.3.4
هسته Android Studio IDE با پیشرفت هایی از IntelliJ IDEA تا نسخه 2018.3.4 به روز شده است.
به روز رسانی پلاگین Android Gradle 3.4.0
برای اطلاعات در مورد جدیدترین افزونه Android Gradle 3.4.0، به یادداشتهای انتشار آن مراجعه کنید.
گفتگوی ساختار پروژه جدید
گفتگوی ساختار پروژه جدید (PSD) بهروزرسانی وابستگیها و پیکربندی جنبههای مختلف پروژه مانند ماژولها، انواع ساخت، پیکربندیهای امضا و متغیرهای ساخت را آسانتر میکند.
با انتخاب File > Project Structure از نوار منو می توانید PSD را باز کنید. همچنین میتوانید PSD را با فشار دادن Ctrl+Shift+Alt+S
در ویندوز و لینوکس یا Command+;
(نقطه ویرگول) در macOS. در زیر می توانید توضیحات برخی از بخش های جدید و به روز شده PSD را بیابید.
متغیرها
بخش متغیرهای جدید PSD به شما این امکان را میدهد که متغیرهای ساخت را ایجاد و مدیریت کنید، مانند متغیرهایی برای ثابت نگه داشتن شماره نسخه برای وابستگیها در سراسر پروژه.
- به سرعت متغیرهای ساختی را که از قبل در اسکریپت های ساخت Gradle پروژه شما وجود دارد، مشاهده و ویرایش کنید.
- متغیرهای ساخت جدید را در سطح پروژه یا ماژول مستقیماً از PSD اضافه کنید.
توجه: اگر فایل های پیکربندی ساخت موجود شما مقادیری را از طریق اسکریپت های پیچیده Groovy اختصاص می دهند، ممکن است نتوانید آن مقادیر را از طریق PSD ویرایش کنید. علاوه بر این، نمی توانید فایل های بیلد نوشته شده در Kotlin را با استفاده از PSD ویرایش کنید.
ماژول ها
ویژگی هایی را پیکربندی کنید که برای همه انواع ساخت در یک ماژول موجود اعمال می شود یا ماژول های جدید را از قسمت Modules به پروژه خود اضافه کنید. به عنوان مثال، اینجا جایی است که می توانید ویژگی های defaultConfig
را پیکربندی کنید یا پیکربندی های امضا را مدیریت کنید.
وابستگی ها
با دنبال کردن مراحل زیر، هر وابستگی را در نمودار وابستگی پروژه خود، همانطور که توسط Gradle در حین همگام سازی پروژه حل شده است، بررسی و تجسم کنید:
- در قسمت سمت چپ PSD، Dependencies را انتخاب کنید.
- در بخش ماژول ها ، ماژولی را انتخاب کنید که می خواهید وابستگی های حل شده را برای آن بررسی کنید.
- در سمت راست PSD، پنجره Resolved Dependencies را باز کنید که در زیر نشان داده شده است.
همچنین می توانید با انتخاب یک ماژول از قسمت Dependencies در PSD، کلیک بر روی دکمه (+) در قسمت Declared Dependencies و انتخاب نوع وابستگی مورد نظر برای اضافه کردن، به سرعت جستجو و وابستگی ها را به پروژه خود اضافه کنید.
بسته به نوع وابستگی که انتخاب میکنید، باید دیالوگی شبیه به شکل زیر ببینید که به شما کمک میکند وابستگی را به ماژول اضافه کنید.
ساخت انواع
در این بخش از PSD، انواع ساخت و طعم محصول را برای هر ماژول در پروژه خود ایجاد و پیکربندی کنید. میتوانید مکاننماهای مانیفست را اضافه کنید، فایلهای ProGuard را اضافه کنید و کلیدهای امضا را اختصاص دهید و موارد دیگر.
پیشنهادات
همانطور که در زیر نشان داده شده است، به روز رسانی های پیشنهادی برای وابستگی های پروژه و متغیرهای ساخت را در بخش پیشنهادات مشاهده کنید.
مدیر منابع جدید
Resource Manager یک پنجره ابزار جدید برای وارد کردن، ایجاد، مدیریت و استفاده از منابع در برنامه شما است. می توانید پنجره ابزار را با انتخاب View > Tool Windows > Resource Manager از نوار منو باز کنید. مدیر منابع به شما اجازه می دهد کارهای زیر را انجام دهید:
- تجسم منابع: میتوانید پیشنمایش نقشهها، رنگها و طرحبندیها را برای یافتن سریع منابع مورد نیاز خود مشاهده کنید.
- واردات انبوه: میتوانید چندین دارایی قابل ترسیم را همزمان با کشیدن و رها کردن آنها در پنجره ابزار مدیریت منابع یا با استفاده از جادوگر Import drawables وارد کنید. برای دسترسی به جادوگر، دکمه (+) را در گوشه سمت چپ بالای پنجره ابزار انتخاب کنید و سپس از منوی کشویی Import Drawables را انتخاب کنید.
- تبدیل SVG به اشیاء
VectorDrawable
: می توانید از جادوگر Import Drawables برای تبدیل تصاویر SVG خود به اشیاءVectorDrawable
استفاده کنید. - داراییها را بکشید و رها کنید: از پنجره ابزار Resource Manager ، میتوانید نقشهها را روی هر دو نمای طراحی و XML Layout Editor بکشید و رها کنید.
- مشاهده نسخه های جایگزین: اکنون می توانید نسخه های جایگزین منابع خود را با دوبار کلیک کردن بر روی یک منبع در پنجره ابزار مشاهده کنید. این نما، نسخههای مختلفی را که ایجاد کردهاید و واجد شرایطی را نشان میدهد که در آن گنجانده شدهاند.
- نمای کاشی و فهرست: می توانید نمای داخل پنجره ابزار را تغییر دهید تا منابع خود را در ترتیبات مختلف تجسم کنید.
برای کسب اطلاعات بیشتر، راهنمای نحوه مدیریت منابع برنامه را بخوانید.
بررسی شناسههای ساخت هنگام نمایهسازی و اشکالزدایی فایلهای APK
وقتی فایلهای نماد اشکالزدایی را برای کتابخانههای به اشتراکگذاشتهشده .so
در داخل APK خود ارائه میکنید، Android Studio تأیید میکند که شناسه ساخت فایلهای نماد ارائهشده با شناسه ساخت کتابخانههای .so
در داخل APK مطابقت دارد.
اگر کتابخانههای بومی را در APK خود با شناسه ساخت میسازید، Android Studio بررسی میکند که آیا شناسه ساخت در فایلهای نماد شما با شناسه ساخت در کتابخانههای بومی شما مطابقت دارد یا خیر و در صورت عدم تطابق، فایلهای نماد را رد میکند. اگر با شناسه ساخت نسازید، ارائه فایلهای نماد نادرست ممکن است مشکلاتی را در رفع اشکال ایجاد کند.
R8 به طور پیش فرض فعال است
R8 شکر زدایی، کوچک کردن، مبهم کردن، بهینهسازی و پاکسازی را در یک مرحله ادغام میکند – که منجر به بهبود قابل توجه عملکرد ساخت میشود. R8 در پلاگین Android Gradle 3.3.0 معرفی شد و اکنون به طور پیش فرض برای پروژه های برنامه و کتابخانه اندروید با استفاده از افزونه 3.4.0 و بالاتر فعال است.
تصویر زیر یک نمای کلی از فرآیند کامپایل قبل از معرفی R8 را ارائه می دهد.
در حال حاضر، با R8، قندزدایی، کوچک کردن، مبهم کردن، بهینه سازی، و dexing (D8) همه در یک مرحله تکمیل می شوند، همانطور که در زیر نشان داده شده است.
به خاطر داشته باشید، R8 برای کار با قوانین موجود ProGuard شما طراحی شده است، بنابراین احتمالاً نیازی به انجام هیچ اقدامی برای بهره مندی از R8 نخواهید داشت. با این حال، از آنجایی که این فناوری متفاوت از ProGuard است که به طور خاص برای پروژه های اندرویدی طراحی شده است، کوچک شدن و بهینه سازی ممکن است منجر به حذف کدهایی شود که ProGuard ممکن است نداشته باشد. بنابراین، در این وضعیت بعید، ممکن است لازم باشد قوانین بیشتری را برای حفظ آن کد در خروجی ساخت خود اضافه کنید.
اگر در استفاده از R8 با مشکلاتی مواجه شدید، سؤالات متداول سازگاری R8 را بخوانید تا بررسی کنید که آیا راه حلی برای مشکل شما وجود دارد یا خیر. اگر راه حلی مستند نیست، لطفاً یک اشکال را گزارش کنید . می توانید R8 را با افزودن یکی از خطوط زیر به فایل gradle.properties
پروژه خود غیرفعال کنید:
# Disables R8 for Android Library modules only.
android.enableR8.libraries = false
# Disables R8 for all modules.
android.enableR8 = false
توجه: برای یک نوع ساخت معین، اگر useProguard
در فایل build.gradle
ماژول برنامه خود روی false
تنظیم کنید، افزونه Android Gradle از R8 برای کوچک کردن کد برنامه شما برای آن نوع ساخت استفاده می کند، صرف نظر از اینکه R8 را در فایل gradle.properties
پروژه خود غیرفعال کنید یا خیر.
ویرایشگر ناوبری اکنون از همه انواع آرگومان پشتیبانی می کند
همه انواع آرگومان های پشتیبانی شده توسط مؤلفه Navigation اکنون در ویرایشگر ناوبری پشتیبانی می شوند. برای اطلاعات بیشتر در مورد انواع پشتیبانی شده، به انتقال داده بین مقصدها مراجعه کنید.
بهبودهای ویرایشگر چیدمان {:#layout-editor}
پنجره Attributes در Layout Editor در یک صفحه منفرد با بخش هایی که می توانید آنها را گسترش دهید تا مشخصه هایی را که می توانید پیکربندی کنید مشخص کنید، ساده شده است. صفحه ویژگی ها همچنین شامل به روز رسانی های زیر است:
- یک بخش Declared Attributes جدید ویژگی هایی را که فایل طرح بندی مشخص می کند فهرست می کند و به شما امکان می دهد تا به سرعت ویژگی های جدید اضافه کنید.
- اکنون صفحه ویژگی ها همچنین نشانگرهایی را در کنار هر ویژگی نشان می دهد که زمانی که مقدار مشخصه مرجع منبع باشد ثابت هستند و در غیر این صورت خالی هستند.
- ویژگیهای دارای خطا یا اخطار اکنون برجسته شدهاند. هایلایت قرمز خطاها را نشان می دهد (مثلاً وقتی از مقادیر طرح بندی نامعتبر استفاده می کنید) و برجسته های نارنجی نشان دهنده هشدارها هستند (مثلاً وقتی از مقادیر کدگذاری شده استفاده می کنید).
اقدام جدید برای وارد کردن سریع وابستگی ها
اگر شروع به استفاده از کلاسهای Jetpack و Firebase خاصی در کد خود میکنید، یک اقدام قصد جدید پیشنهاد میکند که وابستگی کتابخانه Gradle مورد نیاز را به پروژه خود اضافه کنید، اگر قبلاً این کار را نکردهاید. به عنوان مثال، اگر ابتدا به کلاس WorkManager
بدون وارد کردن وابستگی android.arch.work:work-runtime
مورد نیاز ارجاع دهید، یک اقدام intention به شما امکان می دهد تا این کار را به راحتی با یک کلیک انجام دهید، همانطور که در زیر نشان داده شده است.
به طور خاص، از آنجایی که Jetpack کتابخانه پشتیبانی را در بستههای مجزایی که مدیریت و بهروزرسانی آسانتر هستند، دوباره بستهبندی کرد، این اقدام قصد به شما کمک میکند تا به سرعت فقط وابستگیهایی را که برای اجزای Jetpack که میخواهید استفاده کنید، نیاز دارید، اضافه کنید.
3.3 (ژانويه 2019)
اندروید استودیو 3.3 یک نسخه اصلی است که شامل انواع ویژگیها و بهبودهای جدید است.
3.3.2 (مارس 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است. برای مشاهده لیستی از رفع اشکال قابل توجه، پست مربوطه را در وبلاگ Release Updates بخوانید.
3.3.1 (فوریه 2019)
این به روز رسانی جزئی شامل رفع اشکالات مختلف و بهبود عملکرد است.
IntelliJ IDEA 2018.2.2
هسته Android Studio IDE با بهبودهایی از IntelliJ IDEA تا نسخه 2018.2.2 به روز شده است.
به روز رسانی پلاگین Android Gradle
برای کسب اطلاعات در مورد آنچه در افزونه Android Gradle جدید است، به یادداشتهای انتشار آن مراجعه کنید.
ویرایشگر ناوبری
ویرایشگر پیمایش به شما امکان می دهد با استفاده از مؤلفه معماری ناوبری، به سرعت ناوبری را در برنامه خود تجسم و ایجاد کنید.
برای اطلاعات بیشتر، به پیاده سازی ناوبری با مؤلفه معماری پیمایش مراجعه کنید.
دایرکتوری های استفاده نشده اندروید استودیو را حذف کنید
هنگامی که یک نسخه اصلی Android Studio را برای اولین بار اجرا می کنید، به دنبال دایرکتوری هایی می گردد که حاوی حافظه نهان، تنظیمات، شاخص ها و گزارش های مربوط به نسخه هایی از Android Studio است که نصب مربوطه برای آنها یافت نمی شود. سپس کادر گفتگوی Delete Unused Android Studio Directories مکانها، اندازهها و زمانهای آخرین تغییر این فهرستهای بلااستفاده را نمایش میدهد و گزینهای برای حذف آنها ارائه میدهد.
دایرکتوری هایی که اندروید استودیو برای حذف در نظر می گیرد در زیر فهرست شده است:
- لینوکس:
~/.AndroidStudio[Preview] XY
- Mac:
~/Library/{Preferences, Caches, Logs, Application Support}/AndroidStudio[Preview] XY
- Windows:
%USER%.AndroidStudio[Preview] XY
بهبود لینت
وقتی لینت از Gradle فراخوانی می شود، به طور قابل توجهی سریعتر است - پروژه های بزرگتر می توانند انتظار داشته باشند که پرزها تا چهار برابر سریعتر اجرا شوند.
ایجاد جادوگر پروژه جدید
جادوگر Create New Project ظاهر جدیدی دارد و حاوی بهروزرسانیهایی است که به سادهسازی ایجاد پروژههای Android Studio جدید کمک میکند.
برای اطلاعات بیشتر، به ایجاد پروژه مراجعه کنید.
به روز رسانی پروفایل
اندروید استودیو 3.3 شامل بهروزرسانیهایی برای چندین پروفایلکننده فردی است.
عملکرد بهبود یافته است
بر اساس بازخورد کاربران، عملکرد رندر هنگام استفاده از پروفایلرها بسیار بهبود یافته است. لطفاً به ارائه بازخورد ادامه دهید، به خصوص اگر همچنان مشکلات عملکرد را مشاهده می کنید.
گزینه های ردیابی تخصیص حافظه پروفایلر
برای بهبود عملکرد برنامه در حین نمایه سازی، Memory Profiler اکنون به صورت پیش فرض از تخصیص حافظه به صورت دوره ای نمونه برداری می کند. در صورت تمایل، میتوانید این رفتار را با استفاده از منوی کشویی Allocation Tracking هنگام آزمایش بر روی دستگاههای دارای Android 8.0 (سطح API 26) یا بالاتر تغییر دهید.
با استفاده از منوی کشویی ردیابی تخصیص ، می توانید از حالت های زیر انتخاب کنید:
Full: تمام تخصیص حافظه شی را ضبط می کند. توجه داشته باشید که اگر برنامهای دارید که اشیاء زیادی را به خود اختصاص میدهد، ممکن است هنگام نمایهسازی مشکلات عملکرد قابل توجهی مشاهده کنید.
Sampled: نمونه ای دوره ای از تخصیص حافظه شی را می گیرد. این رفتار پیشفرض است و تأثیر کمتری بر عملکرد برنامه در حین نمایهسازی دارد. ممکن است با برخی مشکلات عملکردی در برنامه هایی که در مدت زمان کوتاهی اشیاء زیادی را به آنها اختصاص می دهند، مواجه شوید.
خاموش: تخصیص حافظه را خاموش می کند. اگر قبلاً انتخاب نشده باشد، این حالت هنگام ضبط CPU به طور خودکار فعال می شود و پس از پایان ضبط به تنظیمات قبلی باز می گردد. می توانید این رفتار را در گفتگوی پیکربندی ضبط CPU تغییر دهید.
ردیابی بر اشیاء جاوا و مراجع JNI تأثیر می گذارد.
داده های رندر فریم را بررسی کنید
در نمایهگر CPU ، اکنون میتوانید بررسی کنید که برنامه جاوا چقدر طول میکشد تا هر فریم را روی رشته رابط کاربری اصلی و RenderThread رندر کند. این دادهها ممکن است هنگام بررسی تنگناهایی که باعث jank UI و نرخ فریم پایین میشوند مفید باشد. برای مثال، هر فریمی که بیش از ۱۶ میلیثانیه برای حفظ نرخ فریم صاف طول میکشد، با رنگ قرمز نمایش داده میشود.
برای مشاهده دادههای ارائه فریم، با استفاده از پیکربندی که به شما امکان میدهد تماسهای سیستمی را ردیابی کنید، ردیابی را ثبت کنید . پس از ضبط ردیابی، همانطور که در زیر نشان داده شده است، به دنبال اطلاعات مربوط به هر فریم در امتداد جدول زمانی ضبط در قسمتی به نام FRAMES باشید.
برای کسب اطلاعات بیشتر درباره بررسی و رفع مشکلات نرخ فریم، رندر آهسته را بخوانید.
قطعات در جدول زمانی رویداد
جدول زمانی رویداد اکنون نشان می دهد که قطعات متصل و جدا شده اند. علاوه بر این، هنگامی که ماوس را روی یک قطعه نگه می دارید، یک راهنمای ابزار وضعیت قطعه را به شما نشان می دهد.
متن قالب بندی شده برای بارهای اتصال را در نمایه ساز شبکه مشاهده کنید
پیش از این، نمایه ساز شبکه فقط متن خام را از بارهای اتصال نمایش می داد. Android Studio 3.3 اکنون انواع متن خاصی از جمله JSON، XML و HTML را به صورت پیشفرض قالببندی میکند. در تب Response و Request برای نمایش متن فرمت شده روی لینک View Parsed کلیک کنید و برای نمایش متن خام روی لینک View Source کلیک کنید.
برای اطلاعات بیشتر، به بررسی ترافیک شبکه با Network Profiler مراجعه کنید.
دانلود خودکار اجزای SDK
هنگامی که پروژه شما به یک جزء SDK از پلتفرمهای SDK، NDK یا CMake نیاز دارد، Gradle اکنون تلاش میکند تا بستههای مورد نیاز را تا زمانی که قبلاً با استفاده از مدیر SDK پذیرفته باشید، بهطور خودکار بستههای مورد نیاز را دانلود کند.
برای اطلاعات بیشتر، به دانلود خودکار بستههای گمشده با Gradle مراجعه کنید.
پشتیبانی از Clang-Tidy
Android Studio اکنون شامل پشتیبانی از تجزیه و تحلیل کد استاتیک با استفاده از Clang-Tidy برای پروژه هایی است که شامل کد بومی هستند. برای فعال کردن پشتیبانی از Clang-Tidy، NDK خود را به r18 یا بالاتر به روز کنید .
سپس میتوانید بازرسیها را با باز کردن کادر گفتگوی تنظیمات یا تنظیمات برگزیده و پیمایش به Editor > Inspections > C/C++ > General > Clang-Tidy، فعال یا دوباره فعال کنید. هنگام انتخاب این بازرسی در گفتگوی تنظیمات یا تنظیمات ، میتوانید فهرستی از چکهای Clang-Tidy را که در قسمت گزینه در سمت راست ترین پنل فعال و غیرفعال شدهاند، مشاهده کنید. برای فعال کردن بررسی های اضافی ، آنها را به لیست اضافه کنید و روی اعمال کلیک کنید.
برای پیکربندی Clang-Tidy با گزینه های اضافی ، روی Configure Clang-Tidy Checks Options کلیک کنید و آنها را در گفتگوی باز شده اضافه کنید.
حذف گزینه های سفارشی سازی ++C
گزینه های زیر از گفتگوی Customize C++ Support حذف شده اند:
- پشتیبانی استثنایی (-fexceptions)
- پشتیبانی اطلاعات نوع زمان اجرا (-ftti)
رفتارهای مربوطه برای همه پروژههایی که از طریق Android Studio ایجاد میشوند فعال هستند.
CMake نسخه 3.10.2
نسخه 3.10.2 CMake اکنون با SDK Manager گنجانده شده است. توجه داشته باشید که Gradle همچنان از نسخه 3.6.0 به طور پیش فرض استفاده می کند.
برای تعیین یک نسخه CMake برای Gradle، موارد زیر را به فایل build.gradle
ماژول خود اضافه کنید:
android {
...
externalNativeBuild {
cmake {
...
version "3.10.2"
}
}
}
برای اطلاعات بیشتر در مورد پیکربندی CMake در build.gradle
، به پیکربندی دستی Gradle مراجعه کنید.
نحو جدید "+" برای تعیین حداقل نسخه های CMake
هنگامی که یک نسخه از CMake را در فایل build.gradle
ماژول اصلی خود مشخص می کنید، اکنون می توانید یک "+" را برای مطابقت با رفتار دستور cmake_minimum_required()
CMake اضافه کنید.
احتیاط: استفاده از نحو "+" با سایر وابستگیهای ساخت ممنوع است، زیرا وابستگیهای پویا میتوانند باعث بهروزرسانی غیرمنتظره نسخه و مشکل در حل تفاوتهای نسخه شوند.
Android App Bundles اکنون از برنامههای فوری پشتیبانی میکند
Android Studio اکنون به شما امکان میدهد با پشتیبانی کامل از Google Play Instant، Android App Bundle بسازید. به عبارت دیگر، اکنون میتوانید برنامههای نصب شده و تجربیات فوری را از یک پروژه Android Studio ایجاد و اجرا کنید و آنها را در یک Android App Bundle قرار دهید.
اگر در حال ایجاد یک پروژه Android Studio جدید با استفاده از گفتگوی Create New Project هستید، مطمئن شوید که کادر کنار Configure your project > This project will support instant apps را علامت بزنید. سپس Android Studio مانند معمول یک پروژه برنامه جدید ایجاد میکند، اما ویژگیهای زیر را در مانیفست شما برای افزودن پشتیبانی برنامه فوری به ماژول پایه برنامه شما شامل میشود:
<manifest ... xmlns:dist="http://schemas.android.com/apk/distribution">
<dist:module dist:instant="true" />
...
</manifest>
سپس می توانید با انتخاب File > New > New Module از نوار منو و سپس انتخاب Instant Dynamic Feature Module از کادر گفتگوی Create New Module، یک ماژول ویژگی فعال فوری ایجاد کنید . به خاطر داشته باشید، ایجاد این ماژول ماژول پایه برنامه شما را نیز به صورت فوری فعال می کند.
برای استقرار برنامه خود در یک دستگاه محلی به عنوان یک تجربه فوری، پیکربندی اجرای خود را ویرایش کنید و کادر کنار General > Deploy as instant app را علامت بزنید.
همگام سازی پروژه تک متغیره
همگام سازی پروژه شما با پیکربندی ساخت، گام مهمی در این است که به Android Studio اجازه می دهد تا ساختار پروژه شما را بفهمد. با این حال، این فرآیند برای پروژه های بزرگ می تواند زمان بر باشد. اگر پروژه شما از چندین نوع ساخت استفاده می کند ، اکنون می توانید همگام سازی های پروژه را با محدود کردن آنها فقط به نوع مورد نظر خود در حال حاضر بهینه کنید.
برای فعال کردن این بهینه سازی باید از Android Studio 3.3 یا بالاتر با افزونه Android Gradle 3.3.0 یا بالاتر استفاده کنید. هنگامی که این الزامات را برآورده می کنید ، IDE شما را وادار می کند تا هنگام همگام سازی پروژه خود ، این بهینه سازی را فعال کنید. بهینه سازی نیز به طور پیش فرض در پروژه های جدید فعال می شود.
برای فعال کردن این بهینه سازی به صورت دستی ، روی File> Settings> Experimental> Gradle ( Android Studio> Preferences> Experimental> Gradle در MAC) کلیک کنید و تنها Sync the Active Variant Check Check را انتخاب کنید.
توجه: این بهینه سازی در حال حاضر از پروژه هایی پشتیبانی می کند که فقط زبان برنامه نویسی جاوا را شامل می شود. به عنوان مثال ، IDE کد Kotlin یا C ++ را در پروژه شما تشخیص می دهد ، به طور خودکار این بهینه سازی را فعال نمی کند ، و شما نباید آن را به صورت دستی فعال کنید.
برای اطلاعات بیشتر ، به Sync Project یک متغیر مراجعه کنید.
بازخورد سریع ارائه دهید
اگر برای کمک به بهبود استودیوی اندرویدی تصمیم به اشتراک گذاری آمار استفاده کرده اید ، این دو نماد جدید را در نوار وضعیت در پایین پنجره IDE مشاهده خواهید کرد:


به سادگی روی نمادی که به بهترین وجه نشان دهنده تجربه فعلی شما با IDE است ، کلیک کنید. هنگامی که این کار را انجام دادید ، IDE آمار استفاده را ارسال می کند که به تیم استودیوی Android اجازه می دهد احساسات شما را بهتر درک کند. در بعضی موارد ، مانند زمانی که شما تجربه منفی با IDE را نشان می دهید ، فرصتی برای ارائه بازخورد اضافی خواهید داشت.
اگر قبلاً این کار را نکرده اید ، می توانید با باز کردن تنظیمات تنظیمات تنظیمات تنظیمات در MAC ، آمار استفاده را فعال کنید) ، به ظاهر و رفتار> تنظیمات سیستم> اشتراک داده ها و بررسی ارسال آمار استفاده به Google مراجعه کنید.
3.2 (سپتامبر 2018)
Android Studio 3.2 نسخه اصلی است که شامل انواع ویژگی ها و پیشرفت های جدید است.
3.2.1 (اکتبر 2018)
این به روزرسانی در Android Studio 3.2 شامل تغییرات و اصلاحات زیر است:
- نسخه Kotlin بسته بندی شده اکنون 1.2.71 است.
- نسخه پیش فرض Build Tools اکنون 28.0.3 است.
- در کتابخانه ناوبری ، انواع آرگومان از
type
بهargType
تغییر نام داده شده است. - اشکالات زیر برطرف شده است:
- هنگام استفاده از کتابخانه اتصال داده ، نام های متغیر با زیرکانها باعث ایجاد خطاهای تلفیقی می شدند.
- Cmake باعث ناکامی IntelliSense و سایر ویژگی های Clion شد.
- اضافه کردن یک
SliceProvider
در پروژه هایی کهandroidx.*
کتابخانه ها. - برخی از تست های واحد کوتلین در حال اجرا نبودند.
- مسئله ای با اتصال داده باعث ایجاد
PsiInvalidElementAccessException
شد. -
<merge>
عناصر گاهی اوقات باعث خراب شدن ویرایشگر طرح می شدند.
3.2.0 موضوعات شناخته شده
توجه: این مسائل در Android Studio 3.2.1 برطرف شده است
ما به شدت در مورد استفاده از نسخه Kotlin 1.2.70 توصیه می کنیم.
Kotlin نسخه 1.2.61 اشکالی را برطرف می کند که می تواند استودیوی اندرویدی را آویزان کند ، اما Kotlin 1.2.70 این رفع را شامل نمی شود .
نسخه های Kotlin 1.2.71 و بعد از آن ، این رفع را شامل می شود.
اگرچه شما به طور معمول نیازی به مشخص کردن نسخه Build Tools ندارید ، هنگام استفاده از افزونه Android Gradle 3.2.0 با
renderscriptSupportModeEnabled
تنظیمtrue
، باید موارد زیر را در پرونده هایbuild.gradle
.android.buildToolsVersion "28.0.3"
دستیار جدید چیست
یک دستیار جدید شما را در مورد آخرین تغییرات در Android Studio به شما اطلاع می دهد.
در صورت تشخیص اینکه اطلاعات جدیدی برای نمایش وجود دارد ، دستیار هنگام شروع Android Studio پس از نصب تازه یا به روزرسانی باز می شود. همچنین می توانید با انتخاب راهنما> آنچه در Android Studio جدید است ، دستیار را باز کنید.
اندروید جت پک
Android Jetpack به سرعت بخشیدن به توسعه اندرویدی با مؤلفه ها ، ابزارها و راهنمایی هایی که وظایف تکراری را از بین می برد ، کمک می کند و شما را قادر می سازد تا سریعتر و به راحتی برنامه های قابل آزمایش و قابل آزمایش را بسازید. Android Studio شامل به روزرسانی های زیر برای پشتیبانی از JetPack است. برای اطلاعات بیشتر ، به مستندات JetPack مراجعه کنید.
ویرایشگر ناوبری
ویرایشگر جدید ناوبری با اجزای ناوبری Android Jetpack ادغام می شود تا نمای گرافیکی برای ایجاد ساختار ناوبری برنامه شما ارائه دهد. ویرایشگر ناوبری طراحی و اجرای ناوبری بین مقصد درون برنامه را ساده می کند.
در Android Studio 3.2 ، ویرایشگر ناوبری یک ویژگی آزمایشی است. برای فعال کردن ویرایشگر ناوبری ، روی File> Settings ( Android Studio> Preferences در Mac) کلیک کنید ، دسته آزمایشی را در صفحه سمت چپ انتخاب کنید ، کادر بعدی را برای فعال کردن ویرایشگر ناوبری بررسی کنید و Android Studio را مجدداً راه اندازی کنید.
برای کسب اطلاعات بیشتر ، مستندات ویرایشگر ناوبری را بخوانید.
مهاجرت Androidx
به عنوان بخشی از JetPack ، ما با استفاده از فضای نام androidx
، کتابخانه های پشتیبانی Android را به یک کتابخانه جدید پسوند Android منتقل می کنیم. برای اطلاعات بیشتر ، به نمای کلی Androidx مراجعه کنید.
Android Studio 3.2 با یک ویژگی مهاجرت جدید به شما کمک می کند.
برای مهاجرت یک پروژه موجود به Androidx ، Refactor> Migrate به Androidx را انتخاب کنید. اگر وابستگی های Maven دارید که به فضای نام Androidx مهاجرت نکرده اند ، سیستم ساخت Android Studio نیز به طور خودکار آن وابستگی های پروژه را تبدیل می کند.
افزونه Android Gradle پرچم های جهانی زیر را که می توانید در پرونده gradle.properties
خود تنظیم کنید ، فراهم می کند:
-
android.useAndroidX
: هنگامی که رویtrue
تنظیم شده است ، این پرچم نشان می دهد که از این پس می خواهید از Androidx استفاده کنید. اگر پرچم وجود نداشته باشد ، استودیوی اندرویدی طوری رفتار می کند که انگار پرچم بهfalse
تنظیم شده است. -
android.enableJetifier
: هنگامی که رویtrue
تنظیم شده است ، این پرچم نشان می دهد که شما می خواهید پشتیبانی ابزار (از افزونه Android Gradle) داشته باشید تا به طور خودکار کتابخانه های شخص ثالث موجود را تبدیل کنید که گویی برای Androidx نوشته شده است. اگر پرچم وجود نداشته باشد ، استودیوی اندرویدی طوری رفتار می کند که انگار پرچم بهfalse
تنظیم شده است.
هر دو پرچم هنگام استفاده از دستور مهاجرت به Androidx ، true
تنظیم می شوند.
اگر می خواهید بلافاصله استفاده از کتابخانه های Androidx را شروع کنید و نیازی به تبدیل کتابخانه های شخص ثالث موجود ندارید ، می توانید پرچم android.useAndroidX
را به true
و android.enableJetifier
false
تنظیم کنید.
Android App Bundle
Android App Bundle یک قالب بارگذاری جدید است که شامل تمام کد و منابع کامپایل شده برنامه شما است ، اما تولید APK را نشان می دهد و به فروشگاه Google Play وارد می شود.
سپس مدل برنامه جدید برنامه Google Play از بسته نرم افزاری برنامه شما برای تولید و ارائه APK های بهینه شده برای پیکربندی دستگاه کاربر استفاده می کند ، بنابراین هر کاربر فقط کد و منابع مورد نیاز خود را برای اجرای برنامه شما بارگیری می کند. شما دیگر نیازی به ساخت ، امضا و مدیریت چندین APK ندارید و کاربران بارگیری های کوچکتر و بهینه تری دریافت می کنند.
علاوه بر این ، می توانید ماژول های ویژگی را به پروژه برنامه خود اضافه کرده و آنها را در بسته برنامه خود قرار دهید. سپس کاربران شما می توانند ویژگی های برنامه شما را به صورت تقاضا بارگیری و نصب کنند.
برای ساخت یک بسته نرم افزاری ، Build> Build Bundle (ها) / apk (s)> ساخت بسته (ها) را انتخاب کنید.
برای اطلاعات بیشتر ، از جمله دستورالعمل های ساخت و تجزیه و تحلیل بسته نرم افزاری برنامه Android ، به بسته نرم افزاری برنامه Android مراجعه کنید.
نمونه داده ها در ویرایشگر چیدمان
بسیاری از طرح بندی های اندرویدی دارای داده های زمان اجرا هستند که می تواند تجسم ظاهر و احساس یک طرح را در مرحله طراحی توسعه برنامه دشوار کند. اکنون می توانید به راحتی پیش نمایش نمای خود را در ویرایشگر چیدمان پر از داده های نمونه مشاهده کنید. وقتی یک نمای اضافه می کنید ، یک دکمه در زیر نمای در پنجره طراحی ظاهر می شود. برای تنظیم ویژگی های طراحی زمان ، روی این دکمه کلیک کنید. می توانید از بین انواع الگوهای داده نمونه انتخاب کرده و تعداد موارد نمونه را برای جمع آوری نمای مشخص کنید.
برای استفاده از داده های نمونه ، یک RecyclerView
به یک طرح جدید اضافه کنید ، بر روی دکمه طراحی ویژگی های زمان کلیک کنید در زیر نمای ، و انتخابی از چرخ فلک الگوهای داده نمونه را انتخاب کنید.
برش ها
برش ها روش جدیدی برای تعبیه بخش هایی از عملکرد برنامه شما در سایر سطوح رابط کاربری در Android ارائه می دهند. به عنوان مثال ، برش ها امکان نمایش عملکرد و محتوای برنامه را در پیشنهادات جستجوی Google امکان پذیر می کنند.
Android Studio 3.2 دارای یک الگوی داخلی برای کمک به شما در گسترش برنامه خود با API های ارائه دهنده Slice جدید ، و همچنین چک های جدید LINT برای اطمینان از اینکه در هنگام ساخت برش بهترین روش ها را دنبال می کنید.
برای شروع راست روی یک پوشه پروژه کلیک راست کرده و New> Other> Slice Provider را انتخاب کنید.
برای کسب اطلاعات بیشتر ، از جمله نحوه آزمایش تعامل برش خود ، راهنمای شروع کار را بخوانید.
کوتلین 1.2.61
Android Studio 3.2 Bundles Kotlin 1.2.61 ، و Android SDK جدید با Kotlin بهتر ادغام می شود. برای اطلاعات بیشتر ، به وبلاگ Android Developers مراجعه کنید.
Intellij Idea 2018.1.6
Core Android Studio IDE با پیشرفت از IntelliJ IDEA از طریق نسخه 2018.1.6 به روز شده است.
پروفایل های اندرویدی
ویژگی های جدید Android Profiler را در Android Studio 3.2 امتحان کنید.
جلسات
اکنون می توانید داده های Profiler را به عنوان جلسات ذخیره کنید تا بعداً مجدداً مورد بازرسی و بازرسی قرار گیرد. پروفایل داده های جلسه شما را تا زمانی که IDE را مجدداً راه اندازی کنید ، نگه می دارد.
هنگامی که یک روش ردیابی یا ضبط یک زباله پشته را ضبط می کنید ، IDE این داده ها (به همراه فعالیت شبکه برنامه خود را) به عنوان یک ورود جداگانه به جلسه فعلی اضافه می کند ، و می توانید به راحتی بین ضبط ها برای مقایسه داده ها به عقب و عقب برگردید.
ردیابی سیستم
در CPU Profiler ، پیکربندی سیستم جدید ردیابی را برای بازرسی از پردازنده سیستم دستگاه و فعالیت نخ خود انتخاب کنید. این پیکربندی ردیابی بر روی systrace
ساخته شده است و برای بررسی موضوعات سطح سیستم مانند UI Jank مفید است.
در حالی که از این پیکربندی ردیابی استفاده می کنید ، می توانید با استفاده از کد C/C ++ خود با API ردیابی بومی یا کد جاوا خود با کلاس Trace
، روالهای مهم کد را در جدول زمانی Profiler علامت گذاری کنید.
منابع JNI را در پروفایل حافظه بازرسی کنید
اگر برنامه خود را به دستگاهی که Android 8.0 (API سطح 26) یا بالاتر را اجرا می کند ، مستقر کنید ، اکنون می توانید با استفاده از پروفایل حافظه ، تخصیص حافظه را برای کد JNI برنامه خود بازرسی کنید.
در حالی که برنامه شما در حال اجرا است ، بخشی از جدول زمانی را که می خواهید بازرسی کنید انتخاب کنید و JNI Heap را از منوی کشویی در بالای لیست کلاس انتخاب کنید ، همانطور که در شکل زیر مشاهده می کنید. سپس می توانید اشیاء موجود در پشته را همانطور که به طور معمول می خواهید بازرسی کنید و اشیاء را در برگه Alocation Call Stack کلیک کنید تا ببینید که منابع JNI در کد شما اختصاص داده شده و در کد شما منتشر می شوند.

واردات ، صادرات و بازرسی از پرونده های دفع حافظه
اکنون می توانید پرونده های دفع حافظه .hprof
را که با پروفایل حافظه ایجاد شده است ، وارد ، صادرات و بازرسی کنید.
پرونده .hprof
خود را با کلیک روی شروع جلسه جدید Profiler وارد کنید در صفحه جلسات Profiler و سپس انتخاب بار از پرونده . سپس می توانید داده های آن را در پروفایل حافظه بازرسی کنید همانطور که می خواهید هرگونه زباله پشته دیگر.
برای صرفه جویی در داده های زباله پشته برای بررسی بعدی ، از دکمه Export Heap Dump در سمت راست ورودی زباله پشته در صفحه Sessions استفاده کنید. در گفتگوی Export As که ظاهر می شود ، پرونده را با پسوند نام پرونده .hprof
ذخیره کنید.
ضبط فعالیت CPU در هنگام راه اندازی برنامه
اکنون می توانید فعالیت CPU را در هنگام راه اندازی برنامه خود ضبط کنید ، به شرح زیر:
- Run> ویرایش پیکربندی ها را از منوی اصلی انتخاب کنید.
- در زیر برگه پروفایل پیکربندی اجرای مورد نظر خود ، کادر بعدی را برای شروع ضبط یک ردیابی روش در هنگام راه اندازی ، بررسی کنید.
- برای استفاده از منوی کشویی ، یک پیکربندی ضبط CPU را انتخاب کنید.
- با انتخاب Run> Profile ، برنامه خود را به دستگاهی که Android 8.0 (سطح 26 API 26) یا بالاتر دارد ، مستقر کنید.
ردپای CPU صادرات
بعد از ضبط فعالیت CPU با پروفایل CPU ، می توانید داده ها را به عنوان یک پرونده .trace
صادر کنید تا با دیگران به اشتراک بگذارید یا بعداً بازرسی کنید.
برای صادر کردن اثری پس از ضبط فعالیت CPU ، موارد زیر را انجام دهید:
- بر روی ضبط که می خواهید از جدول زمانی CPU صادر کنید ، کلیک راست کنید.
- Export Trace را از منوی کشویی انتخاب کنید.
- به جایی که می خواهید پرونده را ذخیره کنید بروید و روی ذخیره کلیک کنید.
پرونده های ردیابی CPU را وارد و بازرسی کنید
اکنون می توانید پرونده های .trace
ایجاد شده با API اشکال زدایی یا پروفایل CPU را وارد و بازرسی کنید. (در حال حاضر ، شما نمی توانید ضبط های ردیابی سیستم را وارد کنید.)
با کلیک بر روی شروع جلسه جدید Profiler ، پرونده ردیابی خود را وارد کنید در صفحه جلسات Profiler و سپس انتخاب بار از پرونده . سپس می توانید داده های آن را در پروفایل CPU مشابه آنچه که به طور عادی انجام می دهید ، با استثنائات زیر بازرسی کنید:
- فعالیت CPU در طول جدول زمانی CPU نشان داده نشده است.
- جدول زمانی فعالیت موضوع فقط نشان می دهد که داده های ردیابی برای هر موضوع در دسترس است و نه حالت های واقعی (مانند دویدن ، انتظار یا خواب).
فعالیت CPU را با استفاده از API اشکال زدایی ضبط کنید
اکنون می توانید با ابزار کردن برنامه خود با API اشکال زدایی ، ضبط فعالیت CPU را در CPU Profiler شروع و متوقف کنید. پس از استقرار برنامه خود در یک دستگاه ، پروفایل به طور خودکار هنگام startMethodTracing(String tracePath)
تماس برنامه شما شروع به کار می کند ، و هنگامی که برنامه شما برنامه شما را متوقف می کند ، ضبط فعالیت CPU را شروع می کند ، و در صورت تماس برنامه شما stopMethodTracing()
. ضمن ضبط فعالیت CPU که با استفاده از این API ایجاد می شود ، CPU Profiler API اشکال زدایی را به عنوان پیکربندی ضبط CPU انتخاب شده نشان می دهد.
پروفسور انرژی
پروفیلر انرژی تجسم مصرف انرژی تخمین زده شده از برنامه شما و همچنین رویدادهای سیستم را نشان می دهد که بر میزان مصرف انرژی ، مانند wakelocks ، آلارم و مشاغل تأثیر می گذارد.
هنگامی که برنامه خود را بر روی یک دستگاه متصل یا شبیه ساز Android اجرا می کنید Android 8.0 (API 26) یا بالاتر ، به عنوان یک ردیف جدید در پایین پنجره Profiler ظاهر می شود.
برای به حداکثر رساندن نمای پروفایل انرژی ، روی ردیف انرژی کلیک کنید. نشانگر ماوس خود را روی یک نوار در جدول زمانی قرار دهید تا شاهد خرابی استفاده از انرژی توسط منابع پردازنده ، شبکه و مکان (GPS) و همچنین رویدادهای مربوط به سیستم باشید.
وقایع سیستم که بر مصرف انرژی تأثیر می گذارد ، در جدول زمانی سیستم زیر جدول زمانی انرژی نشان داده شده است. جزئیات وقایع سیستم در محدوده زمانی مشخص شده در صفحه رویداد هنگام انتخاب محدوده زمانی در جدول زمانی انرژی نشان داده شده است.
برای دیدن پشته تماس و سایر جزئیات برای یک رویداد سیستم ، مانند Wakelock ، آن را در صفحه رویداد انتخاب کنید. برای رفتن به کد مسئول یک رویداد سیستم ، روی ورودی در پشته تماس بگیرید.
چک کردن
Android Studio 3.2 شامل بسیاری از ویژگی های جدید و بهبود یافته برای بررسی خط است.
بررسی های جدید LINT به شما کمک می کند تا مشکلات کد رایج را پیدا کنید و شناسایی کنید ، از هشدارها در مورد مسائل مربوط به قابلیت استفاده بالقوه گرفته تا خطاهای اولویت بالا در مورد آسیب پذیری های احتمالی امنیتی.
بررسی های LINT برای قابلیت همکاری Java/Kotlin
برای اطمینان از اینکه کد جاوا شما با کد Kotlin شما به خوبی تعامل دارد ، چک های جدید LINT بهترین شیوه های شرح داده شده در راهنمای Interop Kotlin را اجرا می کنند. نمونه هایی از این چک ها شامل جستجوی حضور حاشیه نویسی های تهی ، استفاده از کلمات کلیدی سخت کوتلین و قرار دادن پارامترهای لامبدا است.
برای فعال کردن این چک ها ، برای باز کردن گفتگوی تنظیمات ، روی File> Settings ( Android Studio> Preferences On Mac) کلیک کنید ، به ویرایشگر> بازرسی ها> Android> Lint> قابلیت همکاری> بخش ارتباطات Kotlin بروید و قوانینی را که می خواهید فعال کنید انتخاب کنید.

برای فعال کردن این چک ها برای ساختهای خط فرمان ، موارد زیر را به پرونده build.gradle
خود اضافه کنید:
android {
lintOptions {
check 'Interoperability'
}
}
چک های شستشو برای برش ها
بررسی های جدید برای برش ها برای اطمینان از ساخت صحیح برش ها به شما کمک می کند. به عنوان مثال ، بررسی های LINT به شما هشدار می دهد اگر شما یک عمل اصلی را به یک برش اختصاص نداده اید.
هدف جدید Gradle
برای استفاده از تمام اصلاحات ایمن که توسط LINT بررسی مستقیم به کد منبع ارائه می شود ، از کار جدید lintFix
Gradle استفاده کنید. نمونه ای از بررسی LINT که نشان می دهد رفع امن برای استفاده از آن ، SyntheticAccessor
است.
به روزرسانی های ابرداده
ابرداده های مختلف ، مانند بررسی بازیگران سرویس ، برای بررسی های LINT برای کار با Android 9 (API سطح 28) به روز شده است.
هشدار اگر در حال اجرا بر روی یک نوع جدید است
اکنون LINT ثبت می کند که کدام نوع و نسخه یک پایه را با آن ضبط می کند ، و اگر آن را بر روی نوع دیگری از نمونه ای که پایه آن ایجاد شده است ، به شما هشدار می دهد.
پیشرفت در بررسی های موجود
Android Studio 3.2 شامل پیشرفت های زیادی در بررسی های موجود در LINT است. به عنوان مثال ، بررسی های چرخه منابع اکنون در مورد انواع منابع اضافی اعمال می شود ، و ردیاب ترجمه می تواند ترجمه های مفقود شده در پرواز را در ویرایشگر پیدا کند.
شناسه ها را کشف کنید
اکنون شناسه های شماره اکنون در مکان های بیشتری نشان داده شده است ، از جمله در پنجره نتایج بازرسی . این امر پیدا کردن اطلاعاتی را که برای فعال کردن یا غیرفعال کردن چک های خاص از طریق lintOptions
در build.gradle
برای شما آسان تر می کند ، برای شما آسان تر می کند.
برای اطلاعات بیشتر ، به گزینه های پیکربندی LINT با Gradle مراجعه کنید.
داده های اتصال v2
اتصال داده V2 اکنون به طور پیش فرض فعال شده و با V1 سازگار است. این بدان معنی است که ، اگر وابستگی های کتابخانه ای را که با V1 تهیه کرده اید ، دارید ، می توانید از آنها با پروژه هایی با استفاده از داده اتصال V2 استفاده کنید. با این حال ، توجه داشته باشید که پروژه هایی با استفاده از V1 نمی توانند وابستگی هایی را که با V2 تهیه شده اند ، مصرف کنند.
D8 Desugaring
در Android Studio 3.1 ، ما مرحله desugaring را در ابزار D8 به عنوان یک ویژگی آزمایشی ادغام کردیم و زمان ساخت کلی را کاهش داد. در Android Studio 3.2 ، Desugaring با D8 به طور پیش فرض روشن می شود.
کوچکتر کد جدید
R8 ابزاری جدید برای کوچک شدن کد و انسداد است که جایگزین Proguard می شود. شما می توانید با استفاده از نسخه پیش نمایش R8 با استفاده از موارد زیر در پرونده gradle.properties
پروژه خود شروع کنید:
android.enableR8 = true
پیش فرض ABIS را برای چند برنامه تغییر داد
هنگام ساختن چندین APK که هر یک از آنها ABI متفاوت را هدف قرار می دهد ، این افزونه دیگر به طور پیش فرض APK را برای ABI های زیر تولید نمی کند: mips
، mips64
و armeabi
.
اگر می خواهید APK هایی بسازید که این ABI ها را هدف قرار دهد ، باید از NDK R16B یا پایین تر استفاده کنید و ABIS را در پرونده build.gradle
خود مشخص کنید ، همانطور که در زیر آمده است:
splits { abi { include 'armeabi', 'mips', 'mips64' ... } }
splits { abi { include("armeabi", "mips", "mips64") ... } }
توجه: این تغییر رفتار همچنین در Android Studio 3.1 RC1 و بالاتر گنجانده شده است.
ویژگی های ویرایشگر بهبود یافته برای پرونده های ساخت Cmake
اگر از CMake برای افزودن کد C و C ++ به پروژه خود استفاده می کنید ، Android Studio اکنون شامل ویژگی های ویرایشگر بهبود یافته است تا به شما در ویرایش اسکریپت های ساخت Cmake خود مانند موارد زیر کمک کند:
- برجسته سازی نحو و تکمیل کد: IDE اکنون تکمیل کد را برای دستورات Cmake مشترک برجسته کرده و پیشنهاد می کند. علاوه بر این ، می توانید با کلیک بر روی آن هنگام فشار دادن کلید کنترل (فرمان در MAC) به یک پرونده بروید.
- اصلاح کد: اکنون می توانید از گزینه Reformat Code IntelliJ برای استفاده از سبک های کد در اسکریپت های ساخت Cmake خود استفاده کنید.
- Refactoring Safe: ابزارهای داخلی سازی داخلی IDE در حال حاضر نیز بررسی می کنید که آیا در حال تغییر نام یا حذف پرونده هایی هستید که در اسکریپت های ساخت Cmake خود به آنها اشاره می کنید.
در پرونده های هدر خارجی حرکت کنید
هنگام استفاده از پنجره Project در نسخه های قبلی Android Studio ، می توانید فقط پرونده های هدر را که متعلق به کتابخانه هایی است که از یک پروژه محلی ساخته اید ، حرکت کنید و بازرسی کنید. با استفاده از این نسخه ، اکنون می توانید پرونده های عنوان را که با وابستگی های کتابخانه ای C/C ++ خارجی که وارد پروژه برنامه خود می شوید ، مشاهده و بازرسی کنید.
اگر قبلاً کد C/C ++ را در پروژه خود قرار داده اید ، با انتخاب View> Windows Tool> Project از منوی اصلی ، پنجره Project را در سمت چپ IDE باز کنید و Android را از منوی کشویی انتخاب کنید. در دایرکتوری CPP ، تمام هدرهایی که در محدوده پروژه برنامه شما قرار دارند ، برای هر یک از وابستگی های محلی C/C ++ شما ، همانطور که در زیر آمده است ، در زیر گره شامل می شوند.

Multidex بومی به طور پیش فرض فعال شده است
نسخه های قبلی Android Studio هنگام استقرار نسخه اشکال زدایی یک برنامه به دستگاهی که Android API سطح 21 یا بالاتر را اجرا می کند ، Multidex بومی را فعال می کند. حال ، چه در حال اعزام به یک دستگاه یا ایجاد APK برای انتشار باشید ، افزونه Android برای Gradle Multidex بومی را برای همه ماژول هایی که minSdkVersion=21
یا بالاتر را تنظیم می کنند ، امکان پذیر می کند.
AAPT2 به مخزن Maven Google منتقل شد
با شروع Android Studio 3.2 ، منبع AAPT2 (ابزار بسته بندی Android Asset 2) مخزن Maven Google است.
برای استفاده از AAPT2 ، همانطور که در اینجا نشان داده شده است ، اطمینان حاصل کنید که وابستگی google()
در پرونده build.gradle
خود دارید:
buildscript { repositories { google() // here jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.0' } } allprojects { repositories { google() // and here jcenter() } }
buildscript { repositories { google() // here jcenter() } dependencies { classpath("com.android.tools.build:gradle:3.2.0") } } allprojects { repositories { google() // and here jcenter() } }
نسخه جدید AAPT2 بسیاری از مسائل را برطرف می کند ، از جمله بهبود عملکرد شخصیت های غیر ASCII در ویندوز.
حذف پیکربندی در صورت تقاضا
پیکربندی در مورد تقاضا از Android Studio حذف شده است.
Android Studio دیگر استدلال --configure-on-demand
را به Gradle منتقل نمی کند.
دستیار اتصال ADB
دستیار جدید اتصال ADB دستورالعمل های گام به گام را برای کمک به شما در تنظیم و استفاده از دستگاه از طریق اتصال Android Debug Bridge (ADB) ارائه می دهد.
برای شروع دستیار ، ابزار> دستیار اتصال را انتخاب کنید.
دستیار اتصال ADB دستورالعمل ها ، کنترل های درون متن و لیستی از دستگاه های متصل را در یک سری از صفحات در پانل دستیار ارائه می دهد.
بهبود شبیه ساز
اکنون می توانید عکسهای فوری AVD (دستگاه مجازی Android) را در هر زمان در Android Emulator ذخیره کرده و بارگذاری کنید ، و بازگشت یک دستگاه تقلید شده به حالت شناخته شده برای آزمایش سریع و آسان است. هنگامی که یک AVD را با استفاده از AVD Manager ویرایش می کنید ، می توانید هنگام شروع AVD ، کدام Snapshot AVD را بارگیری کنید.
کنترل های صرفه جویی ، بارگیری و مدیریت عکسهای فوری AVD اکنون در برگه Snapshots در پنجره کنترل گسترده شبیه ساز وجود دارد.
برای جزئیات بیشتر ، به عکس های فوری مراجعه کنید.
برای کسب اطلاعات بیشتر در مورد آنچه جدید و تغییر یافته در شبیه ساز است ، به یادداشت های انتشار شبیه ساز مراجعه کنید.
3.1 (مارس 2018)
Android Studio 3.1.0 یک نسخه اصلی است که شامل انواع ویژگی ها و پیشرفت های جدید است.
3.1.4 (اوت 2018)
این به روزرسانی در Android Studio 3.1 شامل تغییرات و اصلاحات زیر است:
- Kotlin بسته بندی شده اکنون نسخه 1.2.50 است.
- پروژه های جدید با
kotlin-stdlib-jdk* artifacts
به جای آثار باستانیkotlin-stdlib-jre*
که کاهش می یابد ، ایجاد می شوند. - تجزیه R8 از قوانین Proguard بهبود یافته است.
- اشکالات زیر برطرف شده است:
- تلاش برای اجرای کلاس اصلی Kotlin با یک خطا انجام نشد:
"Error: Could not find or load main class..."
- R8 ضمن انجام بهینه سازی های خاص ، وارد یک حلقه بی نهایت شد.
- با استفاده از دستور تست های شکست خورده در پنجره اجرا ، گاهی به اشتباه پیام "هیچ آزمایشی پیدا نشد" را برگشت داد.
- D8 به درستی نمونه های
invoke-virtual
به درستی انجام نداد ، و باعث تصادف با یکVerifyError
شد:invoke-super/virtual can't be used on private method
- کامپایلر اتصال داده به نسخه قدیمی
com.android.tools:annotations
بستگی داشت. این کامپایلر اکنون در صورت وجود از حاشیه نویسی ابزاری از پروژه پایه استفاده می کند. - Android Studio هنگام استفاده از پروفایل در هنگام انتقال قطعه سقوط کرد.
- این اشکال زدایی هنگام اشکال زدایی یک طرح با جعبه متن سقوط کرد.
- D8 نتوانست برخی از فایل های زیپ را با کاراکترهای خاص بخوانید.
3.1.3 (ژوئن 2018)
این به روزرسانی در Android Studio 3.1 شامل رفع اشکالات زیر است:
- نشت حافظه پس از استفاده از ویرایشگر چیدمان ، اندرویدی استودیوی را کند و پاسخگو نیست. این به روزرسانی شامل رفع اکثر این موارد است. ما قصد داریم به زودی به روزرسانی دیگری را منتشر کنیم تا نشت حافظه اضافی را برطرف کنیم.
- برخی از برنامه های ساخته شده با D8 در برخی از قرص های Verizon Ellipsis سقوط کردند.
- نصب برنامه های ساخته شده با D8 با خطای
INSTALL_FAILED_DEXOPT
در دستگاه هایی که Android 5.0 یا 5.1 را اجرا می کنند (API سطح 21 یا 22) انجام نشد. - برخی از برنامه های کاربردی که از کتابخانه OKHTTP استفاده کرده و با D8 ساخته شده اند و در دستگاه هایی که Android 4.4 را اجرا می کنند (API سطح 19) خراب شده اند.
- Android Studio گاهی اوقات با شروع کار با یک
ProcessCanceledException
در طول شروع کلاس برایcom.intellij.psi.jsp.JspElementType
، شروع به کار نکرد.
3.1.2 (آوریل 2018)
این به روزرسانی در Android Studio 3.1 شامل رفع اشکالات زیر است:
- در بعضی موارد ، استودیوی اندرویدی در حین خروج به طور نامحدود آویزان است.
ساختهای پیکربندی شده با مجموعه های منبع با پیام زیر هنگام فعال شدن سریع اجرا نشد:
"The SourceSet name is not recognized by the Android Gradle Plugin."
- هنگامی که اجرای فوری فعال شد ، ساخت پروژه های جدید Kotlin در هنگام ایجاد فرمان اجرا شکست خورد.
- در حین ویرایش پرونده
build.gradle
، گاهی اوقات تأخیر قابل توجهی بین تایپ کردن یک شخصیت و شخصیت ظاهر شده روی صفحه وجود داشت. ایجاد خرابی در هنگام چاقی در برخی از پروژه ها با تعداد زیادی ماژول یا وابستگی های خارجی ، با پیام خطای زیر رخ داده است:
"RejectedExecutionException: Thread limit exceeded replacing blocked worker"
- محاسبه لیست D8 Main Dex برخی از دعوت های بازتابی را در نظر نگرفت.
این بروزرسانی همچنین شامل تغییراتی است که باعث می شود چک های خط در حال اجرا از Gradle در برخی از سناریوها بسیار سریعتر باشد.
3.1.1 (آوریل 2018)
این به روزرسانی در Android Studio 3.1 شامل رفع اشکالات زیر است:
در بعضی موارد ، هنگامی که یک پروژه ایجاد شده در Android Studio 3.0 برای اولین بار در Android Studio 3.1 افتتاح شد ، Task Gradle-Aware Make از قسمت قبل از راه اندازی در تنظیمات اجرا/اشکال زدایی حذف شد. نتیجه این بود که پروژه ها هنگام کلیک بر روی دکمه Run یا Debug ساخته نشده اند که به نوبه خود باعث خرابی مانند استقرار APK های نادرست و تصادف در هنگام استفاده از اجرای فوری می شود.
برای حل این مشکل ، Android Studio 3.1.1 اضافه کردن Gradle-Aware را به پیکربندی اجرا برای پروژه هایی که این ورودی از دست رفته اند ، انجام می دهد. این اصلاح پس از همگام سازی درجه اول هنگام بارگیری پروژه اتفاق می افتد.
- در صورت فعال شدن پروفایل پیشرفته ، این اشکال زدایی هنگام اشکال زدایی یک طرح با جعبه متن سقوط کرد.
- Android Studio پس از کلیک بر روی انواع ساخت ، یخ زد.
- پرونده های AAR (Android Archive) دو بار ، یک بار در طی فرآیند همگام سازی GRADLE و یک بار در طی فرآیند ساخت Gradle ، استخراج شدند.
- عناصر از برخی از کشورهای بردار وارد شده از پرونده های SVG وجود نداشتند.
- هشدار در مورد استهلاک پیکربندی وابستگی
compile
با راهنمایی بهتر در موردimplementation
و تنظیماتapi
به روز شده است. برای جزئیات بیشتر در مورد انتقال به دور از استفاده از پیکربندیcompile
، به اسناد مربوط به تنظیمات جدید وابستگی مراجعه کنید.
برنامه نویسی/ایده
IntelliJ 2017.3.3
Core Android Studio IDE با پیشرفت از IntelliJ IDEA از طریق نسخه 2017.3.3 به روز شده است. پیشرفت ها شامل تجزیه و تحلیل جریان کنترل بهتر برای مجموعه ها و رشته ها ، بهبود استنباط قابلیت تهی ، اصلاح سریع جدید و موارد دیگر است.
برای جزئیات بیشتر ، به یادداشت های انتشار JetBrains برای IntelliJ Idea 2017.2 و 2017.3 و همچنین یادداشت های انتشار JetBrains برای به روزرسانی های اشکال مراجعه کنید.
بهبود ویرایش SQL با اتاق
هنگامی که از کتابخانه پایگاه داده اتاق استفاده می کنید ، می توانید از چندین پیشرفت در ویرایش SQL استفاده کنید:
- تکمیل کد در یک
Query
، جداول SQL (اشخاص) ، ستون ها ، پارامترهای پرس و جو ، نام مستعار ، پیوستن ، زیرمجموعه ها و بندها را می فهمد. - SQL Syntax برجسته اکنون کار می کند.
- می توانید روی یک نام جدول در SQL راست کلیک کرده و آن را تغییر نام دهید ، که همچنین کد جاوا یا کوتلین مربوطه را بازنویسی می کند (از جمله ، به عنوان مثال ، نوع بازگشت پرس و جو). تغییر نام در جهت دیگر نیز کار می کند ، بنابراین تغییر نام کلاس یا زمینه جاوا کد SQL مربوطه را بازنویسی می کند.
- کاربردهای SQL هنگام استفاده از Find Usages نشان داده می شود (کلیک راست کنید و از منوی زمینه استفاده را انتخاب کنید).
- برای حرکت به اعلامیه یک نهاد SQL در کد جاوا یا کوتلین ، می توانید ضمن کلیک بر روی موجودیت ، کنترل (فرمان در مک) را نگه دارید.
برای اطلاعات در مورد استفاده از SQL با اتاق ، به ذخیره داده ها در یک پایگاه داده محلی با استفاده از اتاق مراجعه کنید.
به روزرسانی به داده های اتصال داده
این به روزرسانی شامل چندین پیشرفت برای اتصال داده ها است:
اکنون می توانید از یک شیء
LiveData
به عنوان یک زمینه قابل مشاهده در عبارات اتصال داده استفاده کنید. کلاسViewDataBinding
اکنون شامل یک روش جدیدsetLifecycle()
است که شما برای مشاهده اشیاءLiveData
استفاده می کنید.کلاس
ObservableField
اکنون می تواند اشیاءObservable
دیگری را در سازنده خود بپذیرد.می توانید یک کامپایلر افزایشی جدید را برای کلاسهای اتصال داده خود پیش نمایش دهید. برای جزئیات بیشتر در مورد این کامپایلر و دستورالعمل های فعال کردن آن ، به کامپایلر اتصال داده V2 مراجعه کنید.
مزایای کامپایلر جدید شامل موارد زیر است:
- کلاسهای
ViewBinding
توسط افزونه Android برای Gradle قبل از کامپایلر جاوا تولید می شوند. - کتابخانه ها کلاس های اتصال خود را هنگام تهیه برنامه ، به جای بازسازی هر بار ، نگه می دارند. این می تواند عملکرد پروژه های چند ماژول را تا حد زیادی بهبود بخشد.
- کلاسهای
کامپایلر و درجه
D8 کامپایلر پیش فرض DEX است
کامپایلر D8 اکنون به طور پیش فرض برای تولید Bytecode Dex استفاده می شود.
این کامپایلر جدید DEX مزایای مختلفی را از جمله موارد زیر به همراه دارد:
- چاقی سریعتر
- استفاده از حافظه پایین
- تولید کد بهبود یافته (تخصیص ثبت بهتر ، جداول رشته ای باهوش تر)
- تجربه اشکال زدایی بهتر هنگام قدم زدن در کد
برای به دست آوردن این مزایا ، نیازی به تغییر در کد یا گردش کار توسعه خود ندارید ، مگر اینکه قبلاً کامپایلر D8 را به صورت دستی غیرفعال کرده باشید.
اگر android.enableD8
را در gradle.properties
خود به false
تنظیم کنید ، آن پرچم را حذف کنید یا آن را true
کنید:
android.enableD8=true
برای جزئیات بیشتر ، به کامپایلر جدید DEX مراجعه کنید.
دفع فنی
برای پروژه هایی که از ویژگی های زبان Java 8 استفاده می کنند ، تخلیه افزایشی به طور پیش فرض فعال می شود که می تواند زمان ساخت را بهبود بخشد.
Desugaring قند نحوی را به شکلی تبدیل می کند که کامپایلر می تواند با کارآیی بیشتری پردازش کند.
شما می توانید با مشخص کردن موارد زیر در پرونده gradle.properties
پروژه خود ، دفع افزایشی را غیرفعال کنید:
android.enableIncrementalDesugaring=false
پنجره خروجی ساده
کنسول Gradle با پنجره ساخت جایگزین شده است که دارای زبانه های همگام سازی و ساخت است.
برای جزئیات بیشتر در مورد نحوه استفاده از پنجره جدید و ساده ساخت ، به مراحل ساخت مراجعه کنید.
به روزرسانی های دسته ای و همزمانی نمایه سازی
همگام سازی Gradle و فرآیندهای نمایه سازی IDE اکنون بسیار کارآمدتر هستند و باعث کاهش زمان در بسیاری از عملیات نمایه سازی اضافی می شوند.
C ++ و LLDB
ما در مراحل برنامه نویسی ، همگام سازی ، ساختمان و اشکال زدایی از توسعه C ++ پیشرفت های با کیفیت و عملکرد بسیاری انجام داده ایم. پیشرفت ها شامل موارد زیر است:
اگر با پروژه های بزرگ C ++ کار می کنید ، باید متوجه پیشرفت چشمگیر در کاهش زمان صرف شده برای ساخت نمادها شوید. زمان همگام سازی نیز برای پروژه های بزرگ بسیار کاهش می یابد.
عملکرد هنگام ساخت و همگام سازی با CMake از طریق استفاده مجدد تهاجمی از نتایج ذخیره شده بهبود یافته است.
افزودن Formatters ("چاپگرهای زیبا") برای ساختار داده های C ++ بیشتر باعث می شود که تولید LLDB خواندن را آسان تر کند.
LLDB اکنون فقط با Android 4.1 (سطح API 16) و بالاتر کار می کند.
توجه: اشکال زدایی بومی با Android Studio 3.0 یا بیشتر روی ویندوز 32 بیتی کار نمی کند. اگر از ویندوز 32 بیتی استفاده می کنید و نیاز به اشکال زدایی از کد بومی دارید ، از Android Studio 2.3 استفاده کنید.
کاتلین
کوتلین به نسخه 1.2.30 ارتقا یافته است
Android Studio 3.1 شامل Kotlin نسخه 1.2.30 است.
کد Kotlin اکنون با بررسی خط فرمان تجزیه و تحلیل شده است
اجرای خط از خط فرمان اکنون کلاسهای Kotlin شما را تجزیه و تحلیل می کند.
برای هر پروژه ای که می خواهید Lint را اجرا کنید ، مخزن Maven Google باید در پرونده سطح بالا build.gradle
گنجانده شود. مخزن Maven در حال حاضر برای پروژه های ایجاد شده در Android Studio 3.0 و بالاتر گنجانده شده است.
ابزارهای عملکرد
نمونه فرآیندهای بومی C ++ با پروفایل CPU
CPU Profiler اکنون شامل یک پیکربندی پیش فرض برای ضبط اثری از موضوعات بومی برنامه شما است. شما می توانید با استفاده از برنامه خود در دستگاهی که Android 8.0 (API سطح 26) یا بالاتر دارد ، از این پیکربندی استفاده کنید و سپس از منوی کشویی تنظیمات ضبط CPU (بومی) استفاده کنید. پس از آن ، اثری را همانطور که به طور معمول انجام می دهید ضبط و بازرسی کنید .
با ایجاد پیکربندی ضبط می توانید تنظیمات پیش فرض مانند فاصله نمونه برداری را تغییر دهید.
برای بازگشت به ردیابی موضوعات جاوا ، پیکربندی نمونه برداری (جاوا) یا ابزار دقیق (جاوا) را انتخاب کنید.
آثار CPU ، نتایج تخصیص حافظه و زباله های پشته را فیلتر کنید
پروفیلر CPU و پروفایل حافظه شامل یک ویژگی جستجو است که به شما امکان می دهد نتایج را از ضبط یک ردیابی روش ، تخصیص حافظه یا زباله های پشته فیلتر کنید.

برای جستجو ، روی فیلتر کلیک کنید در گوشه سمت راست سمت راست صفحه ، پرس و جو خود را تایپ کرده و Enter را فشار دهید.
نکته: همچنین می توانید با فشار دادن Control + F (فرمان + F در Mac) زمینه جستجو را باز کنید.
در برگه نمودار شعله CPU Profiler ، پشته هایی که شامل روش های مربوط به پرس و جو جستجوی شما است ، برجسته شده و به سمت چپ نمودار منتقل می شوند.
برای کسب اطلاعات بیشتر در مورد فیلتر کردن با روش ، کلاس یا نام بسته ، به ردیابی روش ضبط و بازرسی مراجعه کنید.
برگه درخواست در پروفایل شبکه
The Network Profiler now includes a Request tab that provides details about network requests during the selected timeline. In previous versions, the Network Profiler only provided information about network responses.
Thread View in the Network Profiler
After selecting a portion of the timeline in the Network Profiler , you can select one of the following tabs to see more detail about the network activity during that timeframe:
- Connection View : Provides the same information as previous versions of Android Studio—it lists files that were sent or received during the selected portion of the timeline across all of your app's CPU threads. For each request, you can inspect the size, type, status, and transmission duration.
- Thread View : Displays network activity of each of your app's CPU threads. This view allows you to inspect which of your app's threads are responsible for each network request.

بازرس چیدمان
The Layout Inspector gained new features, including some functionality previously provided by the deprecated Hierarchy Viewer and Pixel Perfect tools:
- Zoom buttons and keyboard shortcuts for navigating and inspecting layouts
- Reference grid overlay
- Ability to load a reference image and use it as an overlay (useful for comparing your layout with a UI mockup)
- Render subtree preview to isolate a view in a complex layout

ویرایشگر چیدمان
The Palette in the Layout Editor has received many improvements:
- Reorganization of categories for views and layouts.
- New Common category for views and layouts, which you can add to with a Favorite command.
- Improved search for views and layouts .
- New commands for opening documentation for a specific view or layout element.
You can use the new Convert view command in the Component tree or design editor to convert a view or layout to another type of view or layout.
You can now easily create constraints to items near the selected view using the new Create a connection buttons in the view inspector at the top of the Attributes window.
Run and Instant Run
The behavior of the Use same selection for future launches option in the Select deployment target dialog has been made more consistent. If the Use same selection option is enabled, then the Select deployment target dialog opens only the first time that you use the Run command until the selected device is no longer connected.
When targeting a device running Android 8.0 (API level 26) or higher, Instant Run can deploy changes to resources without causing an application restart. This is possible because the resources are contained in a split APK.
شبیه ساز
For details of what's new and changed in the emulator since Android Studio 3.0, see the Android Emulator release notes from version 27.0.2 through version 27.1.12 .
Major improvements include the following:
- Quick Boot snapshots for saving of emulator state and faster start, with the ability to use the Save now command to save a custom start state.
- Windowless emulator screen.
- System images for Android 8.0 (API level 26), Android 8.1 (API level 27), and Android P Developer Preview.
User interface and user experience improvements
More tooltips, keyboard shortcuts, and helpful messages
We have added tooltips and helpful message overlays in many places throughout Android Studio.
To see keyboard shortcuts for many commands, just hold the mouse pointer over a button until the tooltip appears.
Tools > Android menu removed
The Tools > Android menu has been removed. Commands that were previously under this menu have been moved.
- Many commands moved to directly under the Tools menu.
- The Sync project with gradle files command moved to the File menu.
- The Device Monitor command has been removed, as described below.
Device Monitor available from the command line
In Android Studio 3.1, the Device Monitor serves less of a role than it previously did. In many cases, the functionality available through the Device Monitor is now provided by new and improved tools.
See the Device Monitor documentation for instructions for invoking the Device Monitor from the command line and for details of the tools available through the Device Monitor.
3.0 (October 2017)
Android Studio 3.0.0 is a major release that includes a variety of new features and improvements.
macOS users: If you are updating an older version of Android Studio, you may encounter an update error dialog that says "Some conflicts were found in the installation area". Simply ignore this error and click Cancel to resume the installation.
3.0.1 (November 2017)
This is a minor update to Android Studio 3.0 that includes general bug fixes and performance improvements.
Android Plugin for Gradle 3.0.0
The new Android plugin for Gradle includes a variety of improvements and new features, but it primarily improves build performance for projects that have a large number of modules. When using the new plugin with these large projects, you should experience the following:
- Faster build configuration times due to new delayed dependency resolution.
- Variant-aware dependency resolution for only the projects and variants you are building.
- Faster incremental build times when applying simple changes to code or resources.
Note: These improvements required significant changes that break some of the plugin's behaviors, DSL, and APIs. Upgrading to version 3.0.0 might require changes to your build files and Gradle plugins.
This version also includes the following:
- Support for Android 8.0.
- Support for building separate APKs based on language resources.
- Support for Java 8 libraries and Java 8 language features (without the Jack compiler).
- Support for Android Test Support Library 1.0 (Android Test Utility and Android Test Orchestrator ).
- Improved ndk-build and cmake build speeds.
- Improved Gradle sync speed.
- AAPT2 is now enabled by default.
- Using
ndkCompile
is now more restricted. You should instead migrate to using either CMake or ndk-build to compile native code that you want to package into your APK. To learn more, read Migrate from ndkcompile .
For more information about what's changed, see the Android Plugin for Gradle release notes .
If you're ready to upgrade to the new plugin, see Migrate to Android Plugin for Gradle 3.0.0 .
Kotlin support
As announced at Google I/O 2017 , the Kotlin programming language is now officially supported on Android. So with this release, Android Studio includes Kotlin language support for Android development.
You can incorporate Kotlin into your project by converting a Java file to Kotlin (click Code > Convert Java File to Kotlin File ) or by creating a new Kotlin- enabled project using the New Project wizard.
To get started, read how to add Kotlin to your project .

Java 8 language features support
You can now use certain Java 8 language features and consume libraries built with Java 8. Jack is no longer required , and you should first disable Jack to use the improved Java 8 support built into the default toolchain.
To update your project to support the new Java 8 language toolchain, update the Source Compatibility and Target Compatibility to 1.8 in the Project Structure dialog (click File > Project Structure ). To learn more, read how to use Java 8 language features .

Android Profiler
The new Android Profiler replaces the Android Monitor tool and provides a new suite of tools to measure your app's CPU, memory, and network usage in realtime. You can perform sample-based method tracing to time your code execution, capture heap dumps, view memory allocations, and inspect the details of network-transmitted files.
To open, click View > Tool Windows > Android Profiler (or click Android Profiler in the toolbar).
The event timeline at the top of the window shows touch events, key presses, and activity changes so you have more context to understand other performance events in the timeline.
Note: The Logcat view also moved to a separate window (it was previously inside Android Monitor, which was removed).

From the Android Profiler's overview timeline, click on the CPU , MEMORY , or NETWORK timelines to access the corresponding profiler tools.
CPU Profiler
The CPU Profiler helps you analyze the CPU thread usage of your app by triggering a sample or instrumented CPU trace. Then, you can troubleshoot CPU performance issues using a variety of data views and filters.
For more information, see the CPU Profiler guide .

Memory Profiler
The Memory Profiler helps you identify memory leaks and memory churn that can lead to stutter, freezes, and even app crashes. It shows a realtime graph of your app's memory use, lets you capture a heap dump, force garbage collections, and track memory allocations.
For more information, see the Memory Profiler guide .

Network Profiler
The Network Profiler allows you to monitor the network activity of your app, inspect the payload of each of your network requests, and link back to the code that generated the network request.
For more information, see the Network Profiler guide .

APK profiling and debugging
Android Studio now allows you to profile and debug any APK without having to build it from an Android Studio project—as long as the APK is built to enable debugging and you have access to the debug symbols and source files.
To get started, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or debug APK from the menu bar. This displays the unpacked APK files, but it does not decompile the code. So, to properly add breakpoints and view stack traces, you need to attach Java source files and native debug symbols.
For more information, see Profile and Debug Pre-built APKs .

Device File Explorer
The new Device File Explorer allows you to inspect your connected device's filesystem, and transfer files between the device and your computer. This replaces the filesystem tool available in DDMS.
To open, click View > Tool Windows > Device File Explorer .
For more information, see the Device File Explorer guide .

Instant Apps support
New support for Android Instant Apps allows you to create Instant Apps in your project using two new module types : Instant App modules and Feature modules (these require that you install the Instant Apps Development SDK ).

Android Studio also includes a new modularize refactoring action to help you add support for Instant Apps in an existing project. For example, if you want to refactor your project to place some classes in an Instant App feature module, select the classes in the Project window and click Refactor > Modularize . In the dialog that appears, select the module where the classes should go and click OK .
And when you're ready to test your Instant App, you can build and run your Instant App module on a connected device by specifying the Instant App's URL within the run configuration launch options : Select Run > Edit Configurations , select your Instant App module, and then set the URL under Launch Options .
For more information, see Android Instant Apps .
Android Things modules
New Android Things templates in the New Project and New Module wizards to help you start developing for Android-powered IOT devices.
For more information, see how to create an Android Things project .
Adaptive Icons wizard
Image Asset Studio now supports vector drawables and allows you to create adaptive launcher icons for Android 8.0 while simultaneously creating traditional icons ("Legacy" icons) for older devices.
To start, right-click on the res folder in your project, and then click New > Image Asset . In the Asset Studio window, select Launcher Icons (Adaptive and Legacy) as the icon type.
Note: You must set compileSdkVersion
to 26 or higher to use adaptive launcher icons.
For more information, read about Adaptive Icons .

Support for font resources
To support the new font resources in Android 8.0, Android Studio includes a font resources selector to help bundle fonts into your app or configure your project to download the fonts on the device (when available). The layout editor can also preview the fonts in your layout.
To try downloadable fonts, ensure that your device or emulator is running Google Play Services v11.2.63 or higher. For more information, read about Downloadable Fonts .

Firebase App Indexing Assistant
The Firebase Assistant has been updated with a new tutorial to test App Indexing . To open the Assistant, select Tools > Firebase . Then select App Indexing > Test App Indexing .
The tutorial includes new buttons to test your public and personal content indexing:
- In step 2, click Preview search results to verify that your URLs are showing up in Google Search results.
- In step 3, click Check for errors to verify that the indexable objects in your app have been added to the personal content index.
Android App Links Assistant
The App Links Assistant has been updated with the following new capabilities:
Add URL tests for each URL mapping to be sure your intent filters handle real-world URLs.
You can also define these URL tests by hand using the
<tools:validation>
tag described below.Create a Digital Asset Links file with the appropriate object entry to support Google Smart Lock , and add the corresponding
asset_statements
<meta-data>
tag to your manifest file.

URL intent-filter validator
Android Studio now supports a special tag in the manifest file that allows you to test your intent filter URLs . These are the same tags that the App Links Assistant can create for you .
To declare a test URL for an intent filter, add a <tools:validation>
element alongside the corresponding <intent-filter>
element. به عنوان مثال:
<activity ...>
<intent-filter>
...
</intent-filter>
<tools:validation testUrl="https://www.example.com/recipe/1138" />
</activity>
Be sure to also include xmlns:tools="http://schemas.android.com/tools"
in the <manifest>
tag.
If any one of the test URLs does not pass the intent filter definition, a lint error appears. Such an error still allows you to build debug variants, but it will break your release builds.

ویرایشگر چیدمان
The Layout Editor has been updated with a number of enhancements, including the following:
- New toolbar layout and icons.
- Updated layout in the component tree.
- Improved drag-and-drop view insertions.
- New error panel below the editor, showing all issues with suggestions to fix (if available).
- Various UI enhancements for building with
ConstraintLayout
, including the following:- New support to create barriers .
- New support to create groups: In the toolbar, select Guidelines > Add Group (requires ConstraintLayout 1.1.0 beta 2 or higher)
- New UI to create chains: Select multiple views, and then right-click and select Chain .

بازرس چیدمان
The Layout Inspector includes enhancements to make it easier to debug issues with your app layouts, including grouping properties into common categories and new search functionality in both the View Tree and the Properties panes.

APK Analyzer
You can now use the APK Analyzer from the command line with the apkanalyzer
tool.
The APK Analyzer has also been updated with the following improvements:
- For APKs built with ProGuard, you can load ProGuard mapping files that add capabilities to the DEX viewer, including:
- Bolded nodes to indicate that the nodes should not be removed when shrinking code.
- A button to show nodes that were removed during the shrinking process.
- A button that restores the original names of nodes in the tree view that were obfuscated by ProGuard.
- The DEX Viewer now shows the estimated size impact of each package, class and method.
- New filtering options at the top to show and hide fields and methods.
- In the tree view, nodes that are references not defined in the DEX file appear in italics.
For more information, see Analyze Your Build with APK Analyzer .
Preview for D8 DEX compiler
Android Studio 3.0 includes an optional new DEX compiler called D8. It will eventually replace the DX compiler, but you can opt-in to use the new D8 compiler now.
DEX compilation directly impacts your app's build time, .dex
file size, and runtime performance. And when comparing the new D8 compiler with the current DX compiler, D8 compiles faster and outputs smaller .dex
files, while having the same or better app runtime performance.
To try it, set the following in your project's gradle.properties
file:
android.enableD8=true
For more information, see the blog post about the D8 compiler .
Google's Maven repository
Android Studio now uses Google's Maven Repository by default instead of depending on the Android SDK Manager to get updates for Android Support Library, Google Play Services, Firebase, and other dependencies. This makes it easier to keep your libraries up to date, especially when using a continuous integration (CI) system.
All new projects now include the Google Maven repository by default. To update your existing project, add google()
in the repositories
block of the top-level build.gradle
file:
allprojects {
repositories {
google()
}
}
Learn more about Google's Maven repository here .
تغییرات دیگر
- Native debugging with Android Studio no longer supports 32-bit Windows. We've chosen to focus on other platforms because very few developers are using this platform. If you are using 32-bit Windows and you plan to debug native code, you should keep using Android Studio 2.3 .
- Upgraded the base IDE to IntelliJ 2017.1.2 , which adds a number of new features from 2016.3 and 2017.1 , such as Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, instant results in search, and much more.
- Added many new lint checks.
- Also see the latest Android Emulator updates .
2.3 (March 2017)
Android Studio 2.3.0 is primarily a bug fix and stability release, but it also includes a number of new features.
2.3.3 (June 2017)
This is a minor update to add support for Android O (API level 26).
2.3.2 (April 2017)
This is a minor update to Android Studio 2.3 for the following changes:
- AVD Manager updates to support Google Play in system images.
- Bug fixes for NDK builds when using R14+ of the NDK.
Also see corresponding updates for Android Emulator 26.0.3 .
2.3.1 (April 2017)
This is a minor update to Android Studio 2.3 that fixes an issue where some physical Android devices did not work properly with Instant Run (see Issue #235879 ).
<h3 class="hide-from-toc">
New
</h3>
<div class="video-wrapper-left">
<iframe class="devsite-embedded-youtube-video" data-video-id="VFyKclKBGf0"
data-autohide="1" data-showinfo="0" frameborder="0" allowfullscreen>
</iframe>
</div>
<ul>
<li>Android Studio can now convert PNG, BMP, JPG, and static GIF files to
WebP format. WebP is an image file format from Google that provides lossy
compression (like JPEG) as well as transparency (like PNG) but can provide
better compression than either JPEG or PNG. For more information, see
<a href="/studio/write/convert-webp.html">Convert images to WebP in Android
Studio</a>.
</li>
<li>The new <a href="/studio/write/app-link-indexing.html">App Links
Assistant</a> simplifies the process of adding Android App Links to your app
into a step-by-step wizard. Android App Links are HTTP URLs that bring users
directly to specific content in your Android app.
</li>
<li>The Layout Editor now includes support for two new ConstraintLayout
features:
<ul>
<li>Define a view size based on an aspect ratio.
</li>
<li>Create packed, spread, and weighted linear groups with constraint
chains.
</li>
</ul>
For more information, see <a href=
"/training/constraint-layout/index.html">Build a Responsive UI with
ConstraintLayout</a>.
</li>
<li>The Layout Editor also now lets you create a list of <a href=
"/studio/write/layout-editor.html#edit-properties">favorite attributes</a> so
you don't have to click <b>View all attributes</b> to access the attributes
you use most.
</li>
<li>When adding a material icon using the Vector Import Dialog (<b>File >
New > Vector Asset</b>), you can now filter the list of available icons by
category or by icon name. For more information, see <a href=
"/studio/write/vector-asset-studio.html#materialicon">Adding a material
icon</a>.
</li>
<li>
<a href="/studio/write/annotations.html#accessibility">New and updated
annotations</a>. The new <code>@RestrictTo</code> annotation for methods,
classes, and packages lets you restrict an API. The updated
<code>@VisibleForTesting</code> annotation now has an optional
<code>otherwise</code> argument that lets you designate what the visibility
of a method should be if not for the need to make it visible for testing.
Lint uses the <code>otherwise</code> option to enforce the intended
visibility of the method.
</li>
<li>New <a href="/studio/write/lint.html#snapshot">lint baseline support</a>
allows you to use a snapshot of your project's current set of warnings as a
baseline for future inspection runs so only new issues are reported. The
baseline snapshot lets you start using lint to fail the build for new issues
without having to go back and address all existing issues first.
</li>
<li>New lint checks, including the following:
<ul>
<li>Obsolete <code>SDK_INT</code> Checks: Android Studio removes obsolete
code that checks for SDK versions.
</li>
<li>Object Animator Validation: Lint analyzes your code to make sure that
your <code>ObjectAnimator</code> calls reference valid methods with the
right signatures and checks that those methods are annotated with <code>
@Keep</code> to prevent ProGuard from renaming or removing them during
release builds.
</li>
<li>Unnecessary Item Decorator Copy: Older versions of the
<code>RecyclerView</code> library did not include a divider decorator
class, but one was provided as a sample in the support demos. Recent
versions of the library have a divider decorator class. Lint looks for
the old sample and suggests replacing it with the new one.
</li>
<li>WifiManager Leak: Prior to Android 7.0 (API level 24), initializing
the <code>WifiManager</code> with <code><a href="/reference/android/content/Context.html#getSystemService(java.lang.Class<T>)">Context.getSystemService()</a></code>
can cause a memory leak if the context is not the application context.
Lint looks for these initializations, and if it <em>cannot</em> determine
that the context is the application context, it suggests you use <code><a href="/reference/android/content/Context.html#getApplicationContext()">Context.getApplicationContext()</a></code> to get the proper context for the
initialization.
</li>
<li>Improved Resource Prefix: The existing <code>resourcePrefix</code>
lint check had many limitations. You can now configure your project with
a prefix, such as <code>android { resourcePrefix '<var>my_lib</var>'
}</code>, and lint makes sure that all of your resources are using this
prefix. You can use variations of the name for styles and themes. For
example for the <var>my_lib</var> prefix, you can have themes named
<code>MyLibTheme</code>, <code>myLibAttr</code>,
<code>my_lib_layout</code>, and so on.
</li>
<li>Switch to WebP: This check identifies images in your project that can
be converted to WebP format based on your project’s
<code>minSdkVersion</code> setting. An associated quickfix can
automatically convert the images, or you can <a href=
"/studio/write/convert-webp.html">convert images to WebP</a> manually.
</li>
<li>Unsafe WebP: If your project already includes WebP images, this check
analyzes your project to ensure that your <code>minSdkVersion</code>
setting is high enough to support the included images. For more
information about WebP support in Android and Android Studio, see
<a class="external" href=
"https://developers.google.com/speed/webp/faq#which_web_browsers_natively_support_webp">
Which browsers natively support WebP?</a> and <a href=
"/studio/write/convert-webp.html">Create WebP Images Using Android
Studio</a>.
</li>
</ul>
</li>
</ul>
<h3 class="hide-from-toc">
Changes
</h3>
<ul>
<li>A separate button to push changes with Instant Run: After deploying your
app, you now click <b>Apply Changes</b> <img src=
"/studio/images/buttons/toolbar-apply-changes.svg" alt="" class=
"inline-icon"> to quickly push incremental changes to your running app using
Instant Run. The <b>Run</b> <img src="/studio/images/buttons/toolbar-run.png"
alt="" class="inline-icon"> and <b>Debug</b> <img src=
"/studio/images/buttons/toolbar-debug.png" alt="" class="inline-icon">
buttons are always available to you when you want to reliably push your
changes and force an app restart.
<ul>
<li>Instant Run is supported only when deploying your app to a target
device running Android 5.0 (API level 21) or higher.
</li>
<li>Instant Run is no longer disabled for projects that <a href=
"/studio/projects/add-native-code.html">link to external native
projects</a> using CMake or ndk-build. However, you can only use Instant
Run to push incremental changes to your Java code, not your native code.
</li>
<li>Cold swaps (which you can force for a running app by clicking
<strong>Run</strong> <img src="/studio/images/buttons/toolbar-run.png"
alt="" class="inline-icon">) are now more reliable. Forcing a cold swap
also fixes the issue where changes to notification and widget UIs were
not updated on the target device.
</li>
<li>Includes optimizations that make app startup much faster. These
optimizations may affect profiling, so you should temporarily <a href=
"/studio/run/index.html#disable-ir">disable Instant Run</a> whenever
profiling your app.
</li>
</ul>
</li>
<li>
<p>
The <b>AVD Manager</b> <img src=
"/studio/images/buttons/toolbar-avd-manager.png" alt="" class=
"inline-icon"> and <b>SDK Manager</b> <img src=
"/studio/images/buttons/toolbar-sdk-manager.png" alt="" class=
"inline-icon"> buttons are now included in the lean Navigation Bar as
well as the full Toolbar. To use the lean Navigation Bar, click
<b>View</b> to open the View menu, then ensure that <b>Navigation Bar</b>
is selected and <b>Toolbar</b> is <em>not</em> selected.
</p>
<img src="/studio/images/releases/navigationbar_sdkavd_2x.png" width="757">
</li>
<li>The "Hybrid" debugger has been renamed to "Dual" debugger.
</li>
<li>In the <a href="/studio/run/rundebugconfig.html">Run/Debug
Configurations</a> dialog, under Defaults in the left pane, the following run
configuration names have changed with no behavior changes:
<ul>
<li>The JUnit name has changed to Android JUnit. If you have a project
that uses JUnit run configurations, those configurations are transformed
to Android JUnit run configurations the first time you open the project
with Android Studio. A dialog appears to inform you of the name change.
</li>
<li>The Android Tests name has changed to Android Instrumented Tests.
</li>
</ul>
</li>
<li>The <a href="/studio/debug/am-gpu-debugger.html">GPU Debugger</a> has
been removed from Android Studio as of version 2.3. An open-source,
standalone version of the tool is now available on <a href=
"https://github.com/google/gapid" class="external-link">GitHub</a>.
</li>
<li>The Run/Debug option is no longer available when you right-click a <code>
*.gradle build</code> script.
</li>
<li>All templates now use <code>ConstraintLayout</code> as the default
layout.
</li>
<li>The Widgets palette in the Layout Editor has been redesigned.
</li>
</ul>
<p>
This release also includes a number of bug fixes. <a href=
"https://code.google.com/p/android/issues/list?can=1&q=target%3D2.3+status%3DReleased&colspec=ID+Status+Priority+Owner+Summary+Stars+Reporter+Opened&cells=tiles">
See all bug fixes in 2.3.0.</a>
</p>
<p class="note">
<b>Known issue:</b> Some device manufacturers block apps from automatically
launching after being installed on the device. When deploying your app to a
physical device using Android Studio 2.3, this restriction breaks the
intended behavior of Instant Run and causes the following error output:
<code>Error: Not found; no service started</code>. To avoid this issue,
either <a href="/studio/run/emulator.html">use the emulator</a> or enable
automatic launching for your app in your device's settings. The procedure
for doing this is different for each device, so check the instructions
provided by the manufacturer. To learn more about this issue, see
<a href="https://code.google.com/p/android/issues/detail?id=235879">Issue
#235879</a>.
</p>
2.2 (September 2016)
2.2.3 (December 2016)
<p>
This is a minor update to Android Studio 2.2. It includes a bug fixes
focused around gradle, the core IDE, and lint.
</p>
<p>
Highlighted build changes:
</p>
<ul>
<li>ProGuard version rollback. Due to a <a href=
"https://sourceforge.net/p/proguard/bugs/625/">correctness issue</a>
discovered in ProGuard 5.3.1, we have rolled back to ProGuard 5.2.1. We
have worked with the ProGuard team on getting a fix quickly, and we expect
to roll forward to ProGuard 5.3.2 in Android Studio 2.3 Canary 3.
</li>
<li>Bug fix for <code>aaptOptions</code> <code>IgnoreAssetsPattern</code>
not working properly (<a href="http://b.android.com/224167">issue
224167</a>)
</li>
<li>Bug fix for Gradle autodownload for Constraint Layout library
(<a href="https://code.google.com/p/android/issues/detail?id=212128">issue
212128</a>)
</li>
<li>Bug fix for a JDK8/Kotlin compiler + dx issue (<a href=
"http://b.android.com/227729">issue 227729</a>)
</li>
</ul>
<p>
<a href=
"https://code.google.com/p/android/issues/list?can=1&q=target%3D2.2.3+status%3AReleased+&colspec=ID+Status+Priority+Owner+Summary+Stars+Reporter+Opened&cells=tiles">
See all bug fixes in 2.2.3</a>.
</p>
2.2.2 (October 2016)
<p>
This is a minor update to Android Studio 2.2. It includes a number of small
changes and bug fixes, including:
</p>
<ul>
<li>When reporting Instant Run issues through the IDE, the report now also
includes logcat output for <code>InstantRun</code> events. To help us
improve Instant Run, please <a href=
"/studio/run/index.html#submit-feedback">enable extra logging and report
any issues</a>.
</li>
<li>A number of small bug fixes for Gradle.
</li>
<li>A fix for problems with generating multiple APKs.
</li>
</ul>
2.2.1 (October 2016)
<p>
This is a minor update to Android Studio 2.2. It includes several bug fixes
and a new feature to enable extra logging to help us troubleshoot Instant
Run issues—to help us improve Instant Run, please <a href=
"/studio/run/index.html#submit-feedback">enable extra logging and report
any issues</a>.
</p>
جدید
- All new Layout Editor with tools custom-built to support ConstraintLayout .
<li>New <strong><a href=
"http://tools.android.com/tech-docs/layout-inspector">Layout
Inspector</a></strong> lets you examine snapshots of your layout hierarchy
while your app is running on the emulator or a device.
</li>
<li>New <strong><a href="/studio/write/firebase.html">Assistant</a></strong>
window to help you integrate Firebase services into your app.
</li>
<li>New <strong><a href="/studio/debug/apk-analyzer.html">APK
Analyzer</a></strong> tool so you can inspect the contents of your packaged
app.
</li>
<li>New <strong><a href=
"http://tools.android.com/tech-docs/test-recorder">Espresso Test
Recorder</a></strong> tool (currently in beta) to help you create UI tests by
recording your own interactions.
</li>
<li>New <strong><a href=
"http://tools.android.com/tech-docs/build-cache">build cache</a></strong>
(currently experimental) to speed up build performance.
</li>
<li>New <strong>C/C++ build integration with CMake and ndk-build</strong>.
Compile and build new or existing native code into libraries packaged into
your APK, and debug using lldb. For new projects, Android Studio uses CMake
by default, but also supports ndk-build for existing projects. To learn how
to include native code in your Android application, read <a href=
"/studio/projects/add-native-code.html">Add C and C++ Code to Your
Project</a>. To learn how to debug native code with lldb, see <a href=
"/studio/debug/index.html#debug-native">Debug Native Code</a>.
</li>
<li>New <strong><a href="/studio/intro/index.html#sample-code">Samples
Browser</a></strong> so you can easily look up Google Android sample code
from within Android Studio to jump start app development.
</li>
<li>New <strong>Merged Manifest Viewer</strong> to help you diagnose how your
manifest file merges with your app dependencies across project build
variants.
</li>
<li>The <strong>Run</strong> window now contains log messages for the current
running app. Note that you can configure the <a href=
"/studio/debug/am-logcat.html">logcat Monitor</a> display, but not the
<strong>Run</strong> window.
</li>
<li>New <strong><a href="/studio/run/emulator.html">Android
Emulator</a></strong> features:
<ul>
<li>Added new <strong>Virtual</strong> <strong>Sensors</strong> and
<strong>Cellular</strong> > <strong>Signal Strength</strong> controls.
</li>
<li>Added an <strong>LTE</strong> option to the <strong>Cellular</strong>
> <strong>Network type</strong> control.
</li>
<li>Added simulated vertical swipes for scrolling through vertical menus
with a mouse wheel.
</li>
</ul>
</li>
<li>New <strong><a href="/studio/run/rundebugconfig.html">Run/Debug
Configuration</a></strong> features:
<ul>
<li>The <strong>Debugger</strong> tab of the Android App and Android
Tests templates now contain several new options for debugging with LLDB.
</li>
<li>The <strong>Profiling</strong> tab of the Android App and Android
Tests templates now contain a <strong>Capture GPU Commands</strong>
option for enabling GPU tracing. You can display GPU traces in the GPU
Debugger (a beta feature).
</li>
<li>The Android Tests template now has a <strong>Firebase Test Lab Device
Matrix</strong> option for the <strong>Deployment Target</strong>.
</li>
<li>The Native Application template has been deprecated. If you use this
template in a project, Android Studio automatically converts it to the
Android App template.
</li>
<li>The Android Application template has been renamed to Android App.
</li>
</ul>
</li>
<li>Improved installation, configuration, performance, and UI features in the
<strong><a href="/studio/debug/am-gpu-debugger.html">GPU
Debugger</a></strong> (currently in beta).
</li>
<li>Android Studio now comes bundled with <strong>OpenJDK 8</strong>.
Existing projects still use the JDK specified in <strong>File > Project
Structure > SDK Location</strong>. You can switch to use the new bundled
JDK by clicking <strong>File > Project Structure > SDK
Location</strong> and checking the <strong>Use embedded JDK</strong>
checkbox.
</li>
<li>Added new <strong>help menus and buttons</strong> in the UI so you can
more easily find the online documentation.
</li>
تغییرات
- Updated the IDE codebase from IntelliJ 15 to IntelliJ 2016.1
- Instant Run now requires the platform SDK corresponding to the target device API level to be installed.
- Instant Run will automatically disabled if user is running the app under a work profile or as a secondary user.
- Fixed many reliability issues for Instant Run where changes were not getting deployed or the app would crash:
- Some app assets were not deployed to your running app. ( Bug: #213454 )
- App crashes when user transitions between Instant Run and non Instant Run sessions where a Serializable class does not have serialVersionUID defined. ( Bug: #209006 )
- Style changes aren't reflected with Instant Run. ( Bug: #210851 )
- Instant Run session is unreliable and causes FileNotFoundException. ( Bug: #213083 )
- Changes to drawables not reflected until full rebuild is performed for KitKat. ( Bug: #21530 )
- Resource changes aren't reflected with Instant Run when custom sourceSets contain nested paths. ( Bug: #219145 )
- Hot and warm swap don't work if changed class contains annotation with enum value. ( Bug: #209047 )
- Changes to annotation data not reflected with Instant Run. ( Bug: #210089 )
- Instant Run doesn't pick up code changes if you make changes outside the IDE. ( Bug: #213205 )
- Instant Run session is unreliable due to mismatch security token. ( Bug: #211989
- Cold swap fails for devices that doesn't properly support run-as. ( Bug: #210875 )
- App crash after instant run restart. ( Bug: #219744 )
- ClassNotFoundException observed when switching from Instant Run to Instant Debug. ( Bug: #215805 )
<li>Improved performance for <strong>Gradle sync</strong> within the IDE,
especially for large projects.
</li>
<li>Improved build times for both full and incremental builds with new app
packaging code.
</li>
<li>Improved <strong>Jack compiler performance and features</strong>,
including support for annotation processors and dexing in process. To learn
more, read the <a href=
"/studio/releases/gradle-plugin.html#revisions">Android plugin for Gradle
2.2.0 release notes</a>.
</li>
<li>Removed the <strong>Scale</strong> AVD property from the AVD Manager.
</li>
<li>The Android Emulator <strong>-port</strong> and <strong>-ports</strong>
command-line options now report which ports and serial number the emulator
instance is using, and warn if there are any issues with the values you
provided.
</li>
<li>Improved the <strong><a href=
"/studio/write/create-java-class.html">Create New Class dialog</a></strong>
and the corresponding file templates. <strong>Note:</strong> If you've
previously customized the <strong>AnnotationType</strong>,
<strong>Class</strong>, <strong>Enum</strong>, <strong>Interface</strong>, or
<strong>Singleton</strong> file templates, you need to modify your templates
to comply with the new templates or you won’t be able to use the new fields
in the <strong>Create New Class</strong> dialog.
</li>
<li>Improved the <strong><a href=
"/studio/write/vector-asset-studio.html">Vector Asset Studio</a></strong>
user interface and added support for Adobe Photoshop Document (PSD) files.
</li>
<li>Improved the <strong><a href=
"/studio/write/image-asset-studio.html">Image Asset Studio</a></strong> user
interface.
</li>
<li>Improved the <strong>Theme Editor</strong>'s Resource Picker.
</li>
<li>Fixed memory leaks and reduced overall memory usage in Android Studio.
</li>
<li>Added a <strong>Background</strong> button in the <strong><a href=
"/studio/intro/update.html#sdk-manager">SDK Manager</a></strong> so you can
get back to work and install your packages in the background.
</li>
<li>Improved <strong><a href="/studio/intro/accessibility.html">Accessibility
features</a></strong>, including support for screen readers and keyboard
navigation.
</li>
<li>Enhanced <strong>Code Analysis</strong> includes code quality checks for
Java 8 language usage and more cross-file analysis.
</li>
<li>Several toolbar icons have changed.
</li>
2.1 (April 2016)
The primary changes in this update provide support for development with the Android N Preview.
2.1.3 (August 2016)
This update adds compatibility with Gradle 2.14.1, which includes performance improvements, new features, and an important security fix . For more details, see the Gradle release notes .
By default, new projects in Android Studio 2.1.3 use Gradle 2.14.1. For existing projects, the IDE prompts you to upgrade to Gradle 2.14.1 and Android plugin for Gradle 2.1.3 , which is required when using Gradle 2.14.1 and higher.
2.1.2 (June 2016)
This update includes a number of small changes and bug fixes:
- Instant Run updates and bug fixes.
- Improvements to LLDB performance and crash notifications.
- Fixed a regression in the Android Studio 2.1.1 security update that caused
git rebase
to fail.
2.1.1 (May 2016)
Security release update.
The Android N platform adds support for Java 8 language features , which require a new experimental compiler called Jack. The latest version of Jack is currently supported only in Android Studio 2.1. So if you want to use Java 8 language features, you need to use Android Studio 2.1 to build your app.
Note: Instant Run is disabled when you enable the Jack compiler because they currently are not compatible.
Although Android Studio 2.1 is now stable, the Jack compiler is still experimental and you must enable it with the jackOptions
property in your build.gradle
file.
Other than the changes to support the N Preview, Android Studio 2.1 includes minor bug fixes and the following enhancements:
- The Java-aware C++ debugger is now enabled by default when you're using an N device or emulator and select Native debugger mode (in the Debugger tab for your run/debug configuration).
For other build enhancements, including incremental Java compilation and dexing-in-process,update your Android plugin for Gradle to version 2.1.0.
2.0 (April 2016)
Note: If you are developing for the N Developer Preview, you should use Android Studio 2.1 Preview. Android Studio 2.0 does not support all the features required to target the N Preview.
Instant Run :
- Android Studio now deploys clean builds faster than ever before. Additionally, pushing incremental code changes to the emulator or a physical device is now almost instantaneous. Review your updates without redeploying a new debug build or, in many cases, without restarting the app.
- Instant Run supports pushing the following changes to a running app:
- Changes to the implementation of an existing instance method or static method
- Changes to an existing app resource
- Changes to structural code, such as a method signature or a static field (requires a target device running API level 21 or higher).
- Read the documentation to learn more about Instant Run .
Note: Instant Run is supported only when you deploy the debug build variant, use Android plugin for Gradle version 2.0.0 or higher, and configure your app's module-level
build.gradle
file forminSdkVersion 15
or higher. For the best performance, configure your app forminSdkVersion 21
or higher.
New additions to Lint:
- Inspection of
switch
statements using@IntDef
annotated integers to make sure all constants are handled. To quickly add any missing statements, use the intention action drop-down menu and select Add Missing @IntDef Constants . - Flags for incorrect attempts to use string interpolation to insert version numbers in the
build.gradle
file. - Flags for anonymous classes that extend the
Fragment
class. - Flags for native code in unsafe locations, such as the
res/
andasset/
folders. This flag encourages storing native code in thelibs/
folder, which is then securely packaged into the application'sdata/app-lib/
folder at install time. AOSP: #169950 - Flags for unsafe calls to
Runtime.load()
andSystem.load()
calls. AOSP: #179980 - Find and remove any unused resources by selecting Refactor > Remove Unused Resources from the menu bar. Unused resource detection now supports resources only referenced by unused resources, references in raw files such as
.html
image references, andtools:keep
andtools:discard
attributes used by the Gradle resource shrinker, while considering inactive source sets (such as resources used in other build flavors) and properly handling static field imports. - Checks that implicit API references are supported on all platforms targeted by
minSdkVersion
. - Flags improper usage of
RecyclerView
andParcelable
. -
@IntDef
,@IntRange
, and@Size
inspections are now also checked forint
arrays and varargs.
Additional Improvements :
- Optimized for Android Emulator 2.0, which is faster than ever before, supports a wider range of virtual devices, and features a drastically improved UI. To learn more about the new emulator, read the SDK Tools release notes .
- Improvements to the Android Virtual Device Manager :
- System images are now categorized under the following tabs: Recommended , x86 , and Other .
- Under advanced settings, you can enable multi-core support and specify the number of cores the emulator can use.
- Under advanced settings, you can determine how graphics are rendered on the emulator by selecting one of the following options:
- Hardware: use you computer's graphics card for faster rendering.
- Software: use software-based rendering.
- Auto: let the emulator decide the best option. این تنظیمات پیش فرض است.
- Improved AAPT packaging times by specifying deploy target before the app is built. This allows Android Studio to efficiently package only the resources required by the specified device.
- Added Cloud Test Lab integration to provide on-demand app testing with the convenience and scalability of a cloud service. Learn more about how you can use Cloud Test Lab with Android Studio .
- Added a preview of the new GPU Debugger . For graphics intensive applications, you can now visually step through your OpenGL ES code to optimize your app or game.
- Added Google App Indexing Test. Add support for URLs, app indexing, and search functionality to your apps to help drive more traffic to your app, discover which app content is used most, and attract new users. Test and validate URLs in your app all within Android Studio. See Supporting URLs and App Indexing in Android Studio .
- Upgrades from the latest IntelliJ 15 release, including improved code analysis and performance. See What's New in IntelliJ for a complete description of the new features and enhancements.
- XML editor auto-complete now adds quotations marks when completing attributes. To check if this option is enabled, open the Setting or Preferences dialogue, navigate to Editor > General > Smart Keys , and check the box next to Add quotes for attribute value on attribute completion . Issue: 195113
- The XML editor now supports code completion for data binding expressions.
Android Studio v1.5.1 (December 2015)
اصلاحات و بهبودها:
- Fixed a rendering failure issue in the Layout Editor. Issue: 194612
- Added the ability to vary
description
manifest attributes by configuration. Issue: 194705 - Improved the contrast of the Android Studio Darcula appearance theme in Vector Asset Studio. Issue: 191819
- Added Help button support to Vector Asset Studio.
- Added support for the
%
operator for data binding. Issue: 194045 - Fixed a case where launching an app for debugging resulted in the debugger connecting to the wrong device. Issue: 195167
- Fixed a null pointer exception that could occur when attempting to run an app in certain scenarios.
Android Studio v1.5.0 (November 2015)
اصلاحات و بهبودها:
- Added new Memory Monitor analysis abilities to Android Monitor. When you view an HPROF file captured from this monitor, the display is now more helpful so you can more quickly locate problems, such as memory leaks. To use this monitor, click Android Monitor at the bottom of the main window. In Android Monitor, click the Memory tab. While the monitor is running, click the Dump Java Heap icon, and then click Captures in the main window and double-click the file to view it. Click Capture Analysis on the right. (The Android Device Monitor can't be running at the same time as Android Monitor.)
- Added new deep link and app link support. The Code Editor can automatically create an intent filter for deep linking in the
AndroidManifest.xml
file. It can also generate code to help you integrate with the App Indexing API in an activity in a Java file. A deep link testing feature helps you verify that a specified deep link can launch an app. In the General tab of the Run/Debug Configurations dialog, you can specify deep link launch options. You can also test App Indexing API calls in an activity by using the Android Monitor logcat display. The Androidlint
tool now has warnings for certain issues involving deep links and the App Indexing API. - Added the ability to use short names when code-completing custom views in the Code Editor.
- Added support for more
VectorDrawable
elements to Vector Asset Studio for backward-compatibility. Vector Asset Studio can use these elements to convert vector drawables into PNG raster images to use with Android 4.4 (API level 20) and lower. - Added new
lint
checks for Android TV and Android Auto to give you immediate, actionable feedback in Android Studio, along with several quick fixes. For example, for Android TV, it can report and provide a quick fix for permissions, unsupported hardware,uses-feature
element, and missing banner issues. For Android Auto, it can validate the correct usage in the descriptor file referred from yourAndroidManifest.xml
file, report if there isn't an intent filter for theMediaBrowserService
class, and identify certain voice actions issues. - Added new
lint
checks for insecure broadcast receivers,SSLCertificateSocketFactory
andHostnameVerifier
class uses, andFile.setReadable()
andFile.setWritable()
calls. It also detects invalid manifest resource lookups, especially for resources that vary by configuration. - Fixed a number of stability issues.
Android Studio v1.4.1 (October 2015)
اصلاحات و بهبودها:
- Fixed a Gradle model caching issue that could lead to excessive Gradle syncing when the IDE was restarted.
- Fixed a native debugging deadlock issue.
- Fixed an issue blocking users of the Subversion 1.9 version control system.
- Fixed a Device Chooser dialog problem where after connecting a device that was unauthorized you could no longer select the emulator. Issue: 189658
- Fixed incorrect translation error reporting for locales that have a region qualifier and a translation in the region (but not in the base locale). Issue: 188577
- Fixed a deadlock issue in the Theme Editor related to its interaction with the Layout Editor. Issue: 188070
- Fixed a Theme Editor reload and edit conflict causing attributes to not properly update. Issue: 187726
- Improved Theme Editor performance.
- Fixed an issue where the
android:required
attribute was ignored in the manifest. Issue: 187665
Android Studio نسخه 1.4.0 (سپتامبر 2015)
اصلاحات و بهبودها:
- ابزار Vector Asset Studio برای وارد کردن گرافیک های برداری مانند آیکون های متریال و فایل های SVG اضافه شده است. برای استفاده از این ابزار، در نمای اندروید پنجره Project، روی پوشه res راست کلیک کرده و New > Vector Asset را انتخاب کنید.
- عملکردهای جدید مانیتور اندروید، GPU و شبکه اضافه شده است. برای استفاده از این مانیتورها، روی Android Monitor در پایین پنجره اصلی کلیک کنید. مانیتور دستگاه Android نمی تواند همزمان با مانیتور Android اجرا شود.
- یک پیش نمایش اولیه از ویرایشگر تم جدید اضافه شده است. برای استفاده از این ویژگی، Tools > Android > Theme Editor را انتخاب کنید.
- قالبهای اندروید را برای کتابخانه پشتیبانی طراحی بهروزرسانی کرد. الگوها اکنون شامل پشتیبانی از مشخصات طراحی مواد و همچنین کتابخانه پشتیبانی
appcompat
برای سازگاری با عقب هستند.
Android Studio نسخه 1.3.2 (اوت 2015)
اصلاحات و بهبودها:
- اضافه شدن پشتیبانی از Android 6.0 (سطح API 23)، شامل آیکون های جدید و پشتیبانی مدیر AVD برای ایجاد دستگاه هایی با تراکم صفحه نمایش جدید.
- یک استثنا را که در طول بررسی های به روز رسانی رخ می داد، رفع کرد. شماره: 183068
- مشکلی که در آن مختصات نمای حل نشده میتواند باعث خرابی ویرایشگر طرحبندی شود، برطرف شد. شماره: 178690
- مشکل اخطارهای نوع منبع نامعتبر برطرف شد. شماره: 182433
- بررسی پرز که به اشتباه منابع را بهعنوان خصوصی پرچمگذاری میکرد، رفع شد. شماره: 183120
Android Studio v1.3.1 (August 2015)
اصلاحات و بهبودها:
- Fixed support for creating an Android Wear Android Virtual Device (AVD) on Windows.
- Updated the Project Wizard to use the entered project name.
- Added support to allow the Android SDK to be stored in a read-only directory.
- Updated Android plugin for Gradle version to 1.3.0.
- Fixed issues with launching a debug session from the Android Debug Bridge (adb) Unix shell.
- Fixed the Java package renaming message to show the correct package name.
Android Studio v1.3.0 (July 2015)
اصلاحات و بهبودها:
- Added options to enable developer services , such as Google AdMob and Analytics , in your app from within Android Studio.
- Added additional annotations , such as
@RequiresPermission
,@CheckResults
, and@MainThread
. - Added the capability to generate Java heap dumps and analyze thread allocations from the Memory Monitor . You can also convert Android-specific HPROF binary format files to standard HPROF format from within Android Studio.
- Integrated the SDK Manager into Android Studio to simplify package and tools access and provide update notifications.
Note: The standalone SDK Manager is still available from the command line, but is recommended for use only with standalone SDK installations.
- Added the
finger
command in the emulator console to simulate fingerprint authentication. - Added a
<public>
resource declaration to designate library resources as public and private resources.Note: Requires Android plugin for Gradle version 1.3 or higher.
- Added data binding support to create declarative layouts that bind your application logic to layout elements.
- Added support for a separate test APK module to build test APKs in Android Studio.
- Updated the AVD Manager with HAXM optimizations and improved notifications.
- Added 64-bit ARM and MIPS emulator support for QEMU 2.1.
- Simplified the resolution of Lint warnings by adding quick fixes, such as the automatic generation of Parcelable implementation.
- Added live template support for quick insertion of code snippets.
Android Studio نسخه 1.2.2 (ژوئن 2015)
اصلاحات و بهبودها:
- رفع مشکلات ساخت که مانع از تکمیل ساخت ها می شد.
Android Studio v1.2.1 (May 2015)
اصلاحات و بهبودها:
- Fixed minor performance and feature issues.
Android Studio v1.2.0 (April 2015)
اصلاحات و بهبودها:
- Updated the Android runtime window to include the Memory Monitor tool and added a tab for CPU performance monitoring.
- Added a Captures tab in the left margin to display the captured memory and CPU performance data files, such as CPU method tracking and memory heap snapshots.
- Expanded annotation support with additional metadata annotations and inferred nullability.
- Enhanced the Translations Editor with additional support for Best Current Practice (BCP) 47, which uses 3-letter language and region codes.
- Integrated IntelliJ 14 and 14.1 features for improved code analysis and performance:
- Enhanced debugging to show inline values for variables and referring objects, as well as perform inline evaluation of lambda and operator expressions.
- Added code style detection for tab and indent sizes.
- Added scratch files for code experiments and prototyping without project files.
- Added the simultaneous insertion of opening and closing tags in HTML and XML files.
- Added a built-in Java class decompiler so you can look at what's inside a library for which the source code is not available.
See What's New in IntelliJ for a complete description of the new features and enhancements.
- Added additional Project Views for Scratches , Project Files , Problems , Production , and Tests to enhance project management and access.
- Enhanced the File > Settings menu and dialogs for improved settings access and management.
- Added support for high-density displays for Windows and Linux.
- Added support for 280 dpi resources in the
res/drawable-280dpi/
folder.
Android Studio v1.1.0 (February 2015)
Various fixes and enhancements:
- Added support for the Android Wear watch template.
- Modified new project and module creation to include
res/mipmap
folders for density-specific launcher icons. Theseres/mipmap
folders replace theres/drawable
folders for launcher icons. - Updated launcher icons to have a Material Design look and added an
xxxhdpi
launcher icon. - Added and enhanced Lint checks for region and language combinations, launcher icons, resource names, and other common code problems.
- Added support for Best Current Practice (BCP) language tag 47.
Android Studio v1.0.1 (December 2014)
Various fixes and enhancements:
- Fixed AVD Manager and device.xml file lock issue.
- Fixed the emulator log on Windows systems.
- Fixed issue with creating AVDs with Android Studio and Android SDK installed on different drives on Windows systems.
- Sets the default update channel for new downloads to Stable . If you installed the 1.0.0 version of Android Studio and would like stable, production-ready version updates, use File > Settings > Updates to change to the Stable update channel.
Android Studio v1.0 (December 2014)
Initial release of Android Studio.
Android Studio v0.8.14 (October 2014)
برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio v0.8.6 (August 2014)
برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio نسخه 0.8.0 (ژوئن 2014)
پشتیبانی از پروژه های Android Wear اضافه شد.
برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio v0.5.2 (May 2014)
- برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio v0.4.6 (March 2014)
- برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio نسخه 0.4.2 (ژانویه 2014)
- برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio v0.3.2 (Oct 2013)
- برای مشاهده لیست کامل تغییرات به tools.android.com مراجعه کنید.
Android Studio v0.2.x (July 2013)
- Merged in the latest IntelliJ codebase changes. Includes fixes for issues reported by Studio users such as tweaks to Linux font sizes and font rendering.
- Android Gradle plug-in updated to 0.5.0.
Caution: This new version is not backwards compatible. When opening a project that uses an older version of the plug-in, Studio will show an error stating Gradle <project_name> project refresh failed.
The updated Gradle plug-in includes the following changes:
- Fixed IDE model to contain the output file even if it's customized through the DSL. Also fixed the DSL to get/set the output file on the variant object so that it's not necessary to use
variant.packageApplication or variant.zipAlign
- Fixed dependency resolution so that we resolved the combination of (default config, build types, flavor(s)) together instead of separately.
- Fixed dependency for tests of library project to properly include all the dependencies of the library itself.
- Fixed case where two dependencies have the same leaf name.
- Fixed issue where Proguard rules file cannot be applied on flavors.
All Gradle plugin release notes are available are here: http://tools.android.com/tech-docs/new-build-system .
- Fixed IDE model to contain the output file even if it's customized through the DSL. Also fixed the DSL to get/set the output file on the variant object so that it's not necessary to use
- Gradle errors from aapt no longer point to merged output files in the build/ folder, they point back to the real source locations.
- Parallel Builds. It's now possible to use Gradle's parallel builds. Please be aware that parallel builds are in "incubation" (see Gradle's documentation .) This feature is off by default. To enable it, go to Preferences > Compiler and check the box Compile independent modules in parallel .
- Further work on the new resource repository used for layout rendering, resource folding in the editor, and more:
- Basic support for .aar library dependencies (eg using a library without a local copy of the sources). Still not working for resource XML validation and navigation in source editors.
- Cycle detection in resource references.
- Quick Documentation (F1), which can show all translations of the string under the caret, will now also show all resource overlays from the various Gradle flavors and build types, as well as libraries. They are listed in reverse resource overlay order, with strikethrough on the versions of the string that are masked.
- Fixes to handle updating the merged resources when the set of module dependencies change.
- XML rendering fixes to properly handle character entity declarations and XML and unicode escapes.
- Save screenshot support for the layout preview and layout editor windows.
- Template bug fixes.
- Lint bug fixes.
- Various fixes for crash reports. Thank you, and keep filing crash reports!
Android Studio v0.1.x (May 2013)
- Various bug fixes, including a fix for a common Windows installation issue.
Older releases of Android Gradle Plugin
3.6.0 (February 2020)
This version of the Android plugin requires the following:
Gradle 5.6.4 . To learn more, read the section about updating Gradle .
SDK Build Tools 28.0.3 or higher.
3.6.4 (July 2020)
This minor update supports compatibility with new default settings and features for package visibility in Android 11 .
See the 4.0.1 release notes for details.
ویژگی های جدید
This version of the Android Gradle plugin includes the following new features.
مشاهده صحافی
View binding provides compile-time safety when referencing views in your code. You can now replace findViewById()
with the auto-generated binding class reference. To start using View binding, include the following in each module's build.gradle
file:
android { viewBinding.enabled = true }
android { viewBinding.enabled = true }
To learn more, read the View Binding documentation .
Support for the Maven Publish plugin
The Android Gradle plugin includes support for the Maven Publish Gradle plugin , which allows you to publish build artifacts to an Apache Maven repository. The Android Gradle plugin creates a component for each build variant artifact in your app or library module that you can use to customize a publication to a Maven repository.
To learn more, go to the page about how to use the Maven Publish plugin .
New default packaging tool
When building the debug version of your app, the plugin uses a new packaging tool, called zipflinger , to build your APK. This new tool should provide build speed improvements. If the new packaging tool doesn't work as you expect, please report a bug . You can revert to using the old packaging tool by including the following in your gradle.properties
file:
android.useNewApkCreator=false
Native build attribution
You can now determine the length of time it takes Clang to build and link each C/C++ file in your project. Gradle can output a Chrome trace that contains timestamps for these compiler events so you can better understand the time required to build your project. To output this build attribution file, do the following:
Add the flag
-Pandroid.enableProfileJson=true
when running a Gradle build. به عنوان مثال:gradlew assembleDebug -Pandroid.enableProfileJson=true
Open the Chrome browser and type
chrome://tracing
in the search bar.Click the Load button and navigate to
<var>project-root</var>/build/android-profile
to find the file. The file is namedprofile-<var>timestamp</var>.json.gz
.
You can see the native build attribution data near the top of the viewer:
تغییر رفتار
When using this version of the plugin, you might encounter the following changes in behavior.
Native libraries packaged uncompressed by default
When you build your app, the plugin now sets extractNativeLibs
to "false"
by default. That is, your native libraries are page aligned and packaged uncompressed. While this results in a larger upload size, your users benefit from the following:
- Smaller app install size because the platform can access the native libraries directly from the installed APK, without creating a copy of the libraries.
- Smaller download size because Play Store compression is typically better when you include uncompressed native libraries in your APK or Android App Bundle.
If you want the Android Gradle plugin to instead package compressed native libraries, include the following in your app's manifest:
<application
android:extractNativeLibs="true"
... >
</application>
Note: The extractNativeLibs
manifest attribute has been replaced by the useLegacyPackaging
DSL option. For more information, see the release note Use the DSL to package compressed native libraries .
Default NDK version
If you download multiple versions of the NDK, the Android Gradle plugin now selects a default version to use in compiling your source code files. Previously, the plugin selected the latest downloaded version of the NDK. Use the android.ndkVersion
property in the module's build.gradle
file to override the plugin-selected default.
Simplified R class generation
The Android Gradle plugin simplifies the compile classpath by generating only one R class for each library module in your project and sharing those R classes with other module dependencies. This optimization should result in faster builds, but it requires that you keep the following in mind:
- Because the compiler shares R classes with upstream module dependencies, it's important that each module in your project uses a unique package name.
- The visibility of a library's R class to other project dependencies is determined by the configuration used to include the library as a dependency. For example, if Library A includes Library B as an 'api' dependency, Library A and other libraries that depend on Library A have access to Library B's R class. However, other libraries might not have access to Library B's R class. If Library A uses the
implementation
dependency configuration. To learn more, read about dependency configurations .
Remove resources missing from default configuration
For Library modules, if you include a resource for a language that you do not include in the default set of resources—for example, if you include hello_world
as a string resource in /values-es/strings.xml
but you don't define that resource in /values/strings.xml
—the Android Gradle plugin no longer includes that resource when compiling your project. This behavior change should result in fewer Resource Not Found
runtime exceptions and improved build speed.
D8 now respects CLASS retention policy for annotations
When compiling your app, D8 now respects when annotations apply a CLASS retention policy, and those annotations are no longer available at runtime. This behavior also exists when setting the app's target SDK to API level 23, which previously allowed access to these annotations during runtime when compiling your app using older versions of the Android Gradle plugin and D8.
Other behavior changes
-
aaptOptions.noCompress
is no longer case sensitive on all platforms (for both APK and bundles) and respects paths that use uppercase characters. Data binding is now incremental by default. To learn more, see issue #110061530 .
All unit tests, including Roboelectric unit tests, are now fully cacheable. To learn more, see issue #115873047 .
رفع اشکال
This version of the Android Gradle plugin includes the following bug fixes:
- Robolectric unit tests are now supported in library modules that use data binding. To learn more, see issue #126775542 .
- You can now run
connectedAndroidTest
tasks across multiple modules while Gradle's parallel execution mode is enabled.
مسائل شناخته شده
This section describes known issues that exist in Android Gradle plugin 3.6.0.
Slow performance of Android Lint task
Android Lint can take much longer to complete on some projects due to a regression in its parsing infrastructure, resulting in slower computation of inferred types for lambdas in certain code constructs.
The issue is reported as a bug in IDEA and will be fixed in Android Gradle Plugin 4.0.
Missing Manifest class {:#agp-missing-manifest}
If your app defines custom permissions in its manifest, the Android Gradle plugin typically generates a Manifest.java
class that includes your custom permissions as string constants. The plugin packages this class with your app, so you can more easily reference those permissions at runtime.
Generating the manifest class is broken in Android Gradle plugin 3.6.0. If you build your app with this version of the plugin, and it references the manifest class, you might see a ClassNotFoundException
exception. برای حل این مشکل یکی از موارد زیر را انجام دهید:
Reference your custom permissions by their fully-qualified name. For example,
"com.example.myapp.permission.DEADLY_ACTIVITY"
.Define your own constants, as shown below:
public final class CustomPermissions { public static final class permission { public static final String DEADLY_ACTIVITY="com.example.myapp.permission.DEADLY_ACTIVITY"; } }
3.5.0 (August 2019)
Android Gradle plugin 3.5.0, along with Android Studio 3.5 , is a major release and a result of Project Marble, which is a focus on improving three main areas of the Android developer tools: system health, feature polish, and fixing bugs. Notably, improving project build speed was a main focus for this update.
برای کسب اطلاعات درباره این و سایر بهروزرسانیهای Project Marble، پست وبلاگ Android Developers یا بخشهای زیر را بخوانید.
This version of the Android plugin requires the following:
Gradle 5.4.1 . To learn more, read the section about updating Gradle .
SDK Build Tools 28.0.3 or higher.
3.5.4 (July 2020)
This minor update supports compatibility with new default settings and features for package visibility in Android 11 .
See the 4.0.1 release notes for details.
3.5.3 (دسامبر 2019)
This minor update supports Android Studio 3.5.3 and includes various bug fixes and performance improvements.
3.5.2 (نوامبر 2019)
This minor update supports Android Studio 3.5.2 and includes various bug fixes and performance improvements. To see a list of noteable bug fixes, read the related post on the Release Updates blog .
3.5.1 (اکتبر 2019)
This minor update supports Android Studio 3.5.1 and includes various bug fixes and performance improvements. To see a list of noteable bug fixes, read the related post on the Release Updates blog .
Incremental annotation processing
The Data Binding annotation processor supports incremental annotation processing if you set android.databinding.incremental=true
in your gradle.properties
file. This optimization results in improved incremental build performance. For a full list of optimized annotation processors, refer to the table of incremental annotation processors .
Additionally, KAPT 1.3.30 and higher also support incremental annotation processors, which you can enable by including kapt.incremental.apt=true
in your gradle.properties
file.
Cacheable unit tests
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.properties
file:
android.testConfig.useRelativePath = true
مسائل شناخته شده
When using Kotlin Gradle plugin 1.3.31 or earlier, you might see the following warning when building or syncing your project:
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'.
To resolve this issue , upgrade the plugin to version 1.3.40 or higher.
3.4.0 (April 2019)
This version of the Android plugin requires the following:
Gradle 5.1.1 or higher. To learn more, read the section about updating Gradle .
Note: When using Gradle 5.0 and higher, the default Gradle daemon memory heap size decreases from 1 GB to 512 MB. This might result in a build performance regression. To override this default setting, specify the Gradle daemon heap size in your project's
gradle.properties
file.SDK Build Tools 28.0.3 or higher.
3.4.3 (July 2020)
This minor update supports compatibility with new default settings and features for package visibility in Android 11 .
See the 4.0.1 release notes for details.
3.4.2 (July 2019)
This minor update supports Android Studio 3.4.2 and includes various bug fixes and performance improvements. To see a list of noteable bug fixes, read the related post on the Release Updates blog .
3.4.1 (May 2019)
This minor update supports Android Studio 3.4.1 and includes various bug fixes and performance improvements. To see a list of noteable bug fixes, read the related post on the Release Updates blog .
ویژگی های جدید
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.-
lintChecks
: This is an existing configuration that you should use for lint checks you want to only run when building your project locally. If you were previously using thelintChecks
dependency configuration to include lint checks in the published AAR, you need to migrate those dependencies to instead use the newlintPublish
configuration described below. -
lintPublish
: Use this new configuration in library projects for lint checks you want to include in the published AAR, as shown below. This means that projects that consume your library also apply those lint checks.
The following code sample uses both dependency configurations in a local Android library project.
dependencies { // Executes lint checks from the ':lint' project at build time. lintChecks project(':lint') // Packages lint checks from the ':lintpublish' in the published AAR. lintPublish project(':lintpublish') }
dependencies { // Executes lint checks from the ':lint' project at build time. lintChecks(project(":lint")) // Packages lint checks from the ':lintpublish' in the published AAR. lintPublish(project(":lintpublish")) }
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 .
-
تغییر رفتار
Android Instant Apps Feature plugin deprecation warning: If you're still using the
com.android.feature
plugin to build your instant app, Android Gradle plugin 3.4.0 will give throw you a deprecation warning. 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.3.0 and is now enabled by default for both app and Android library projects using plugin 3.4.0 and higher.
The image below provides a high-level overview of the compile process before R8 was introduced.

Now, with R8, desugaring, shrinking, obfuscating, optimizing, and dexing (D8) are all completed in one step, as illustrated below.

Keep in mind, R8 is designed to work with your existing ProGuard rules, so you'll likely not need to take any actions to benefit from R8. However, because it's a different technology to ProGuard that's designed specifically for Android projects, shrinking and optimization may result in removing code that ProGuard may have not. So, in this unlikely situation, you might need to add additional rules to keep that code in your build output.
If you experience issues using R8, read the R8 compatibility FAQ to check if there's a solution to your issue. If a solution isn't documented, please report a bug . You can disable R8 by adding one of the following lines to your project's gradle.properties
file:
# Disables R8 for Android Library modules only.
android.enableR8.libraries = false
# Disables R8 for all modules.
android.enableR8 = false
Note: For a given build type, if you set useProguard
to false
in your app module's build.gradle
file, the Android Gradle plugin uses R8 to shrink your app's code for that build type, regardless of whether you disable R8 in your project's gradle.properties
file.
-
ndkCompile
is deprecated: You now get a build error if you try to usendkBuild
to compile your native libraries. You should instead use either CMake or ndk-build to Add C and C++ code to your project .
مسائل شناخته شده
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.4.0, you can opt-in to check whether your project declares acceptable package names by adding the line below to your
gradle.properties
file.android.uniquePackageNames = true
To learn more about setting a package name through the Android Gradle plugin, see Set the application ID .
3.3.0 (January 2019)
This version of the Android plugin requires the following:
Gradle 4.10.1 or higher. To learn more, read the section about updating Gradle .
Note: When using Gradle 5.0 and higher, the default Gradle daemon memory heap size decreases from 1 GB to 512 MB. This might result in a build performance regression. To override this default setting, specify the Gradle daemon heap size in your project's
gradle.properties
file.SDK Build Tools 28.0.3 or higher.
3.3.3 (July 2020)
This minor update supports compatibility with new default settings and features for package visibility in Android 11 .
See the 4.0.1 release notes for details.
3.3.2 (March 2019)
This minor update supports Android Studio 3.3.2 and includes various bug fixes and performance improvements. To see a list of noteable bug fixes, read the related post on the Release Updates blog .
3.3.1 (February 2019)
This minor update supports Android Studio 3.3.1 and includes various bug fixes and performance improvements.
ویژگی های جدید
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.0 and the compile classpath includes Library A version 1.0, the plugin automatically updates the dependency on the compile classpath to Library A version 2.0 to avoid errors.
However, if the runtime classpath includes Library A version 1.0 and the compile includes Library A version 2.0, the plugin does not downgrade the dependency on the compile classpath to Library A version 1.0, and you will get an error. 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.
Note: This feature is compatible with Gradle 4.10.1 and higher, except Gradle 5.1 due to Gradle issue 8194 .
For projects using Kapt (most Kotlin-only projects and Kotlin-Java hybrid projects): Incremental Java compilation is enabled, even when you use data binding or the retro-lambda plugin. Annotation processing by the Kapt task is not yet incremental.
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 5277 .
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.properties
file:android.enableSeparateAnnotationProcessing=true
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.properties
file:android.debug.obsoleteApi=true
You can also enable the flag by passing
-Pandroid.debug.obsoleteApi=true
from the command line.You can run instrumentation tests on feature modules from the command line.
تغییر رفتار
Lazy task configuration: The plugin now uses Gradle's new task creation API to avoid initializing and configuring tasks that are not required to complete the current build (or tasks not on the execution task graph). For example, if you have multiple build variants, such as “release” and “debug” build variants, and you're building the “debug” version of your app, the plugin avoids initializing and configuring tasks for the “release” version of your app.
Calling certain older methods in the Variants API, such as
variant.getJavaCompile()
, might still force task configuration. To make sure that your build is optimized for lazy task configuration, invoke new methods that instead return a TaskProvider object, such asvariant.getJavaCompileProvider()
.If you execute custom build tasks, learn how to adapt to Gradle's new task-creation API .
For a given build type, when setting
useProguard false
, the plugin now uses R8 instead of ProGuard to shrink and obfuscate your app's code and resources. To learn more about R8, read this blog post from the Android Developer's Blog.Faster R class generation for library projects: Previously, the Android Gradle plugin would generate an
R.java
file for each of your project's dependencies and then compile those R classes alongside your app's other classes. The plugin now generates a JAR containing your app's compiled R class directly, without first building intermediateR.java
classes. This optimization may significantly improve build performance for projects that include many library subprojects and dependencies, and improve the indexing speed in Android Studio.When building an Android App Bundle , APKs generated from that app bundle that target Android 6.0 (API level 23) or higher now include uncompressed versions of your native libraries by default. 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.properties
file:android.bundle.enableUncompressedNativeLibs = false
The plugin enforces minimum versions of some third-party plugins.
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.3 or higher with Android Gradle Plugin 3.3.0 or higher to enable this optimization. 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.
To enable this optimization manually, click File > Settings > Experimental > Gradle ( Android Studio > Preferences > Experimental > Gradle on a Mac) and select the Only sync the active variant checkbox.
Note : This optimization fully supports projects that include Java and C++ languages, and has some support for Kotlin. When enabling the optimization for projects with Kotlin content, Gradle sync falls back to using full variants internally.
Automatic downloading of missing SDK packages : This functionality has been expanded to support NDK. To learn more, read Auto-download missing packages with Gradle .
رفع اشکال
Android Gradle plugin 3.3.0 fixes the following issues:
- The build process calling
android.support.v8.renderscript.RenderScript
instead of the AndroidX version, despite Jetifier being enabled - Clashes due to
androidx-rs.jar
including statically bundledannotation.AnyRes
- When using RenderScript, you no longer have to manually set the Build Tools version in your
build.gradle
files
- The build process calling
3.2.0 (September 2018)
This version of the Android plugin requires the following:
- Gradle 4.6 or higher. To learn more, read the section about updating Gradle .
- SDK Build Tools 28.0.3 or higher.
3.2.1 (October 2018)
With this update, you no longer need to specify a version for the SDK Build Tools. The Android Gradle plugin now uses version 28.0.3 by default.
ویژگی های جدید
Support for building Android App Bundles: The app bundle is a new upload format that includes all your app's compiled code and resources while deferring APK generation and signing to the Google Play Store. 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 extendsCommandLineArgumentProvider
, 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 .Migration tool for AndroidX: When using Android Gradle plugin 3.2.0 with Android 3.2 and higher, you can migrate your project's local and Maven dependencies to use the new AndroidX libraries by selecting Refactor > Migrate to AndroidX from the menu bar. Using this migration tool also sets the following flags to
true
in yourgradle.properties
file:android.useAndroidX
: When set totrue
, the Android plugin uses the appropriate AndroidX library instead of a Support Library. When this flag is not specified, the plugin sets it tofalse
by default.android.enableJetifier
: When set totrue
, the Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries. When this flag is not specified, the plugin sets it tofalse
by default. You can set this flag totrue
only whileandroid.useAndroidX
is also set totrue
, otherwise you get a build error.To learn more, read the AndroidX overview .
New code shrinker, R8: R8 is a new tool for code shrinking and obfuscation that replaces ProGuard. You can start using the preview version of R8 by including the following in your project's
gradle.properties
file:android.enableR8 = true
android.enableR8 = true
تغییر رفتار
Desugaring with D8 is now enabled by default.
AAPT2 is now on Google's Maven repo. To use AAPT2, make sure that you have the
google()
dependency in yourbuild.gradle
file, as shown below:buildscript { repositories { google() // here jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.0' } } allprojects { repositories { google() // and here jcenter() }
buildscript { repositories { google() // here jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.0' } } allprojects { repositories { google() // and here jcenter() }
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. Now, whether you're deploying to a device or building an APK for release, the Android Gradle plugin enables native multidex for all modules that set
minSdkVersion=21
or higher.The plugin now enforces a minimum version of the protobuf plugin (0.8.6), Kotlin plugin (1.2.50), and Crashlytics plugin (1.25.4).
The feature module plugin,
com.android.feature
, now enforces the use of only letters, digits, and underscores when specifying a module name. For example, if your feature module name includes dashes, you get a build error. This behavior matches that of the dynamic feature plugin.
رفع اشکال
- JavaCompile is now cacheable in projects with data binding. ( Issue #69243050 )
- Better compile avoidance for library modules with data binding. ( Issue #77539932 )
- You can now re-enable configure-on-demand if you've disable it in earlier versions due to some unpredictable build errors. ( Issue #77910727 )
3.1.0 (March 2018)
This version of the Android plugin requires the following:
Gradle 4.4 or higher.
To learn more, read the section about updating Gradle .
Build Tools 27.0.3 or higher.
Keep in mind, you no longer need to specify a version for the build tools using the
android.buildToolsVersion
property—the plugin uses the minimum required version by default.
New DEX compiler, D8
By default, Android Studio now uses a new DEX compiler called D8. DEX compilation is the process of transforming .class
bytecode into .dex
bytecode for the Android Runtime (or Dalvik, for older versions of Android). 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.properties
file:
android.enableD8=false
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.properties
file:
android.enableIncrementalDesugaring=false.
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. So, if you are accessing APIs that exist in the JDK but not in the SDK build tools libraries, you get a compile error.
تغییر رفتار
When building multiple APKs that each target a different ABI, the no longer generates APKs for the following ABIs by default:
mips
,mips64
, andarmeabi
.If you want to build APKs that target these ABIs, you must use NDK r16b or lower and specify the ABIs in your
build.gradle
file, as shown below:splits { abi { include 'armeabi', 'mips', 'mips64' ... } }
splits { abi { include("armeabi", "mips", "mips64") ... } }
The Android plugin's build cache now evicts cache entries that are older than 30 days.
Passing
"auto"
toresConfig
no longer automatically picks string resources to package into your APK. If you continue to use"auto"
, the plugin packages all string resources your app and its dependencies provide. So, you should instead specify each locale that you want the plugin to package into your APK.Because local modules can't depend on your app's test APK, adding dependencies to your instrumented tests using the
androidTestApi
configuration, instead ofandroidTestImplementation
, causes Gradle to issue the following warning:WARNING: Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'
WARNING: Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'
رفع می کند
- Fixes an issue where Android Studio doesn't properly recognize dependencies in composite builds.
- Fixes an issue where you get a project sync error when loading the Android plugin multiple times in a single build–for example, when multiple subprojects each include the Android plugin in their buildscript classpath.
3.0.0 (October 2017)
Android Gradle plugin 3.0.0 includes a variety of changes that aim to address performance issues of large projects.
For example, on a sample skeleton project with ~130 modules and a large number of external dependencies (but no code or resources), you can experience performance improvements similar to the following:
Android plugin version + Gradle version | Android plugin 2.2.0 + Gradle 2.14.1 | Android plugin 2.3.0 + Gradle 3.3 | Android plugin 3.0.0 + Gradle 4.1 |
---|---|---|---|
Configuration (eg running ./gradlew --help ) | ~2 mins | ~9 s | ~2.5 s |
1-line Java change (implementation change) | ~2 mins 15 s | ~29 s | ~6.4 s |
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 version of the Android plugin requires the following:
- Gradle 4.1 or higher. To learn more, read the section about updating Gradle .
- Build Tools 26.0.2 or higher. With this update, you no longer need to specify a version for the build tools—the plugin uses the minimum required version by default. So, you can now remove the
android.buildToolsVersion
property.
3.0.1 (November 2017)
This is a minor update to support Android Studio 3.0.1, and includes general bug fixes and performance improvements.
بهینه سازی ها
- 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
, andruntimeOnly
. - 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.enableAapt2=false
in yourgradle.properties
file and restarting the Gradle daemon by running./gradlew --stop
from the command line.
ویژگی های جدید
- 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.
- Includes a new Feature module plugin to support Android Instant Apps and the Android Instant Apps SDK (which you can download using the SDK manager ). 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.execution
to determine whether to use on-device test orchestration. If you want to use Android Test Orchestrator , you need to specifyANDROID_TEST_ORCHESTRATOR
, as shown below. By default, this property is set toHOST
, which disables on-device orchestration and is the standard method of running tests.
شیار
android { testOptions { execution 'ANDROID_TEST_ORCHESTRATOR' } }
کاتلین
android { testOptions { execution = "ANDROID_TEST_ORCHESTRATOR" } }
- Added
New
androidTestUtil
dependency configuration allows you to install another test helper APK before running your instrumentation tests, such as Android Test Orchestrator:شیار
dependencies { androidTestUtil 'com.android.support.test:orchestrator:1.0.0' ... }
کاتلین
dependencies { androidTestUtil("com.android.support.test:orchestrator:1.0.0") ... }
Added
testOptions.unitTests.includeAndroidResources
to support unit tests that require Android resources, such as Roboelectric . When you set this property totrue
, the plugin performs resource, asset, and manifest merging before running your unit tests. Your tests can then inspectcom/android/tools/test_config.properties
on the classpath for the following keys:android_merged_assets
: the absolute path to the merged assets directory.Note: For library modules, the merged assets do not contain the assets of dependencies (see issue #65550419 ).
android_merged_manifest
: the absolute path to the merged manifest file.android_merged_resources
: the absolute path to the merged resources directory, which contains all the resources from the module and all its dependencies.android_custom_package
: the package name of the final R class. If you dynamically modify the application ID, this package name may not match thepackage
attribute in the app's manifest.
- Support for fonts as resources (which is a new feature introduced in Android 8.0 (API level 26) ).
- Support for language-specific APKs with Android Instant Apps SDK 1.1 and higher.
You can now change the output directory for your external native build project, as shown below:
شیار
android { ... externalNativeBuild { // For ndk-build, instead use the ndkBuild block. cmake { ... // Specifies a relative path for outputs from external native // builds. You can specify any path that's not a subdirectory // of your project's temporary build/ directory. buildStagingDirectory "./outputs/cmake" } } }
کاتلین
android { ... externalNativeBuild { // For ndk-build, instead use the ndkBuild block. cmake { ... // Specifies a relative path for outputs from external native // builds. You can specify any path that's not a subdirectory // of your project's temporary build/ directory. buildStagingDirectory = "./outputs/cmake" } } }
- You can now use CMake 3.7 or higher when building native projects from Android Studio.
New
lintChecks
dependency configuration allows you to build a JAR that defines custom lint rules, and package it into your AAR and APK projects.Your custom lint rules must belong to a separate project that outputs a single JAR and includes only
compileOnly
dependencies. Other app and library modules can then depend on your lint project using thelintChecks
configuration:شیار
dependencies { // This tells the Gradle plugin to build ':lint-checks' into a lint.jar file // and package it with your module. If the module is an Android library, // other projects that depend on it automatically use the lint checks. // If the module is an app, lint includes these rules when analyzing the app. lintChecks project(':lint-checks') }
کاتلین
dependencies { // This tells the Gradle plugin to build ':lint-checks' into a lint.jar file // and package it with your module. If the module is an Android library, // other projects that depend on it automatically use the lint checks. // If the module is an app, lint includes these rules when analyzing the app. lintChecks(project(":lint-checks")) }
تغییر رفتار
- Android plugin 3.0.0 removes certain APIs, and your build will break if you use them. For example, you can no longer use the Variants API to access
outputFile()
objects or useprocessManifest.manifestOutputFile()
to get the manifest file for each variant. To learn more, read API changes . - You no longer need to specify a version for the build tools (so, you can now remove the
android.buildToolsVersion
property). By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using. - You now enable/disable PNG crunching in the
buildTypes
block, as shown below. PNG crunching is enabled by default for all builds except debug builds because it increases build times for projects that include many PNG files. So, to improve build times for other build types, you should either disable PNG crunching or convert your images to WebP .شیار
android { buildTypes { release { // Disables PNG crunching for the release build type. crunchPngs false } } }
کاتلین
android { buildTypes { release { // Disables PNG crunching for the release build type. isCrunchPngs = false } } }
- The Android plugin now automatically builds executable targets that you configure in your external CMake projects.
- You must now add annotation processors to the processor classpath using the
annotationProcessor
dependency configuration. - Using the deprecated
ndkCompile
is now more restricted. You should instead migrate to using either CMake or ndk-build to compile native code that you want to package into your APK. To learn more, read Migrate from ndkcompile .
3.0.0 (October 2017)
Android Gradle plugin 3.0.0 includes a variety of changes that aim to address performance issues of large projects.
For example, on a sample skeleton project with ~130 modules and a large number of external dependencies (but no code or resources), you can experience performance improvements similar to the following:
Android plugin version + Gradle version | Android plugin 2.2.0 + Gradle 2.14.1 | Android plugin 2.3.0 + Gradle 3.3 | Android plugin 3.0.0 + Gradle 4.1 |
---|---|---|---|
Configuration (eg running ./gradlew --help ) | ~2 mins | ~9 s | ~2.5 s |
1-line Java change (implementation change) | ~2 mins 15 s | ~29 s | ~6.4 s |
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 version of the Android plugin requires the following:
- Gradle 4.1 or higher. To learn more, read the section about updating Gradle .
- Build Tools 26.0.2 or higher. With this update, you no longer need to specify a version for the build tools—the plugin uses the minimum required version by default. So, you can now remove the
android.buildToolsVersion
property.
3.0.1 (November 2017)
This is a minor update to support Android Studio 3.0.1, and includes general bug fixes and performance improvements.
بهینه سازی ها
- 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
, andruntimeOnly
. - 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.enableAapt2=false
in yourgradle.properties
file and restarting the Gradle daemon by running./gradlew --stop
from the command line.
ویژگی های جدید
- 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.
- Includes a new Feature module plugin to support Android Instant Apps and the Android Instant Apps SDK (which you can download using the SDK manager ). 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.execution
to determine whether to use on-device test orchestration. If you want to use Android Test Orchestrator , you need to specifyANDROID_TEST_ORCHESTRATOR
, as shown below. By default, this property is set toHOST
, which disables on-device orchestration and is the standard method of running tests.
شیار
android { testOptions { execution 'ANDROID_TEST_ORCHESTRATOR' } }
کاتلین
android { testOptions { execution = "ANDROID_TEST_ORCHESTRATOR" } }
- Added
New
androidTestUtil
dependency configuration allows you to install another test helper APK before running your instrumentation tests, such as Android Test Orchestrator:شیار
dependencies { androidTestUtil 'com.android.support.test:orchestrator:1.0.0' ... }
کاتلین
dependencies { androidTestUtil("com.android.support.test:orchestrator:1.0.0") ... }
Added
testOptions.unitTests.includeAndroidResources
to support unit tests that require Android resources, such as Roboelectric . When you set this property totrue
, the plugin performs resource, asset, and manifest merging before running your unit tests. Your tests can then inspectcom/android/tools/test_config.properties
on the classpath for the following keys:android_merged_assets
: the absolute path to the merged assets directory.Note: For library modules, the merged assets do not contain the assets of dependencies (see issue #65550419 ).
android_merged_manifest
: the absolute path to the merged manifest file.android_merged_resources
: the absolute path to the merged resources directory, which contains all the resources from the module and all its dependencies.android_custom_package
: the package name of the final R class. If you dynamically modify the application ID, this package name may not match thepackage
attribute in the app's manifest.
- Support for fonts as resources (which is a new feature introduced in Android 8.0 (API level 26) ).
- Support for language-specific APKs with Android Instant Apps SDK 1.1 and higher.
You can now change the output directory for your external native build project, as shown below:
شیار
android { ... externalNativeBuild { // For ndk-build, instead use the ndkBuild block. cmake { ... // Specifies a relative path for outputs from external native // builds. You can specify any path that's not a subdirectory // of your project's temporary build/ directory. buildStagingDirectory "./outputs/cmake" } } }
کاتلین
android { ... externalNativeBuild { // For ndk-build, instead use the ndkBuild block. cmake { ... // Specifies a relative path for outputs from external native // builds. You can specify any path that's not a subdirectory // of your project's temporary build/ directory. buildStagingDirectory = "./outputs/cmake" } } }
- You can now use CMake 3.7 or higher when building native projects from Android Studio.
New
lintChecks
dependency configuration allows you to build a JAR that defines custom lint rules, and package it into your AAR and APK projects.Your custom lint rules must belong to a separate project that outputs a single JAR and includes only
compileOnly
dependencies. Other app and library modules can then depend on your lint project using thelintChecks
configuration:شیار
dependencies { // This tells the Gradle plugin to build ':lint-checks' into a lint.jar file // and package it with your module. If the module is an Android library, // other projects that depend on it automatically use the lint checks. // If the module is an app, lint includes these rules when analyzing the app. lintChecks project(':lint-checks') }
کاتلین
dependencies { // This tells the Gradle plugin to build ':lint-checks' into a lint.jar file // and package it with your module. If the module is an Android library, // other projects that depend on it automatically use the lint checks. // If the module is an app, lint includes these rules when analyzing the app. lintChecks(project(":lint-checks")) }
تغییر رفتار
- Android plugin 3.0.0 removes certain APIs, and your build will break if you use them. For example, you can no longer use the Variants API to access
outputFile()
objects or useprocessManifest.manifestOutputFile()
to get the manifest file for each variant. To learn more, read API changes . - You no longer need to specify a version for the build tools (so, you can now remove the
android.buildToolsVersion
property). By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using. - You now enable/disable PNG crunching in the
buildTypes
block, as shown below. PNG crunching is enabled by default for all builds except debug builds because it increases build times for projects that include many PNG files. So, to improve build times for other build types, you should either disable PNG crunching or convert your images to WebP .شیار
android { buildTypes { release { // Disables PNG crunching for the release build type. crunchPngs false } } }
کاتلین
android { buildTypes { release { // Disables PNG crunching for the release build type. isCrunchPngs = false } } }
- The Android plugin now automatically builds executable targets that you configure in your external CMake projects.
- You must now add annotation processors to the processor classpath using the
annotationProcessor
dependency configuration. - Using the deprecated
ndkCompile
is now more restricted. You should instead migrate to using either CMake or ndk-build to compile native code that you want to package into your APK. To learn more, read Migrate from ndkcompile .
2.3.0 (February 2017)
2.3.3 (June 2017)
This is a minor update that adds compatibility with Android Studio 2.3.3 .
2.3.2 (May 2017)
This is a minor update that adds compatibility with Android Studio 2.3.2 .
2.3.1 (April 2017)
This is a minor update to Android plugin 2.3.0 that fixes an issue where some physical Android devices did not work properly with Instant Run (see Issue #235879 ).
- وابستگی ها:
- Gradle 3.3 or higher.
- Build Tools 25.0.0 or higher.
- جدید:
- Uses Gradle 3.3, which includes performance improvements and new features. For more details, see the Gradle release notes .
- Build cache : stores certain outputs that the Android plugin generates when building your project (such as unpackaged AARs and pre-dexed remote dependencies). Your clean builds are much faster while using the cache because the build system can simply reuse those cached files during subsequent builds, instead of recreating them. Projects using Android plugin 2.3.0 and higher use the build cache by default. To learn more, read Improve Build Speed with Build Cache .
- Includes a
cleanBuildCache
task that clears the build cache . - If you are using the experimental version of build cache (included in earlier versions of the plugin), you should update your plugin to the latest version.
- Includes a
- تغییرات:
- Supports changes to Instant Run included in Android Studio 2.3 .
- Configuration times for very large projects should be significantly faster.
- Fixed issues with auto-downloading for the constraint layout library .
- Plugin now uses ProGuard version 5.3.2 .
- Includes many fixes for reported bugs . Please continue to file bug reports when you encounter issues.
2.2.0 (September 2016)
- وابستگی ها:
- Gradle 2.14.1 or higher.
- Build Tools 23.0.2 or higher.
- جدید:
- 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 .
- Using the
externalNativeBuild {}
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 Project . - When you run a build from the command line , Gradle now attempts to auto-download any missing SDK components or updates that your project depends on. To learn more, read Auto-download missing packages with Gradle .
- 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 Cache guide.
- Improves build performance by adopting a new default packaging pipeline which handles zipping, signing, and zipaligning in one task. You can revert to using the older packaging tools by adding
android.useOldPackaging=true
to yourgradle.properties
file. While using the new packaging tool, thezipalignDebug
task is not available. However, you can create one yourself by calling thecreateZipAlignTask(String taskName, File inputFile, File outputFile)
method. - APK signing now uses APK Signature Scheme 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:شیار
android { ... signingConfigs { config { ... v2SigningEnabled false } } }
کاتلین
android { ... signingConfigs { create("config") { ... v2SigningEnabled = false } } }
- 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
. Using this DSL is different from usingbuildTypes.proguardFiles
, which provides general ProGuard rules for your app and does not specify classes for the main DEX file. - 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 tofalse
in the<application>
element of your app manifest, Gradle packages uncompressed and aligned versions of your native libraries with your APK. This preventsPackageManager
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. - You can now specify
versionNameSuffix
andapplicationIdSuffix
for product flavors. ( Issue 59614 )
- تغییرات:
-
getDefaultProguardFile
now returns the default ProGuard files that Android plugin for Gradle provides and no longer uses the ones in the Android SDK. - Improved Jack compiler performance and features:
- Jack now supports Jacoco test coverage when setting
testCoverageEnabled
totrue
. - 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 thejavaCompileOptions.annotationProcessorOptions {}
DSL in your module-levelbuild.gradle
file:شیار
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")) } } } }
If you want to apply an annotation processor at compile time but not include it in your APK, use the
annotationProcessor
dependency scope:شیار
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 }
- 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:# This sets the daemon heap size to 1.5GB. org.gradle.jvmargs=-Xmx1536M
For a list of parameters you can set, run the following from the command line:
java -jar /build-tools/jack.jar --help-properties
- Jack now supports Jacoco test coverage when setting
-
2.1.0 (April 2016)
2.1.3 (August 2016)
This update requires Gradle 2.14.1 and higher. Gradle 2.14.1 includes performance improvements, new features, and an important security fix . For more details, see the Gradle release notes .
- وابستگی ها:
- Gradle 2.10 or higher.
- Build Tools 23.0.2 or higher.
- جدید:
- Added support for the N Developer Preview, JDK 8, and Java 8 language features using the Jack toolchain. To find out more, read the N Preview guide .
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 default support for incremental Java compilation to reduce compilation time during development. It does this by only recompiling portions of the source that have changed or need to be recompiled. To disable this feature, add the following code to your module-level
build.gradle
file:شیار
android { ... compileOptions { incremental false } }
کاتلین
android { ... compileOptions { incremental = false } }
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 2048 MB. You can do this by including the following in your project's
```none org.gradle.jvmargs = -Xmx2048m ```gradle.properties
file:If you have defined a value for
```none org.gradle.jvmargs = -Xmx3072m ```javaMaxHeapSize
in your module-levelbuild.gradle
file, you need to setorg.gradle.jvmargs
to the value ofjavaMaxHeapSize
+ 1024 MB. For example, if you have setjavaMaxHeapSize
to "2048m", you need to add the following to your project'sgradle.properties
file:To disable dexing-in-process, add the following code to your module-level
build.gradle
file:شیار
android { ... dexOptions { dexInProcess false } }
کاتلین
android { ... dexOptions { dexInProcess = false } }
- Added support for the N Developer Preview, JDK 8, and Java 8 language features using the Jack toolchain. To find out more, read the N Preview guide .
2.0.0 (April 2016)
- وابستگی ها:
- Gradle 2.10 or higher.
- Build Tools 21.1.1 or higher.
- جدید:
- Enables Instant Run by supporting bytecode injection, and pushing code and resource updates to a running app on the emulator or a physical device.
- Added support for incremental builds, even when the app isn't running. Full build times are improved by pushing incremental changes through the Android Debug Bridge to the connected device.
- Added
maxProcessCount
to control how many worker dex processes can be spawned concurrently. The following code, in the module-levelbuild.gradle
file, sets the maximum number of concurrent processes to 4:شیار
android { ... dexOptions { maxProcessCount = 4 // this is the default value } }
کاتلین
android { ... dexOptions { maxProcessCount = 4 // this is the default value } }
</li> <li>Added an experimental code shrinker to support pre-dexing and reduce re-dexing of dependencies, which are not supported with Proguard. This improves the build speed of your debug build variant. Because the experimental shrinker does not support optimization and obfuscation, you should enable Proguard for your release builds. To enable the experimental shrinker for your debug builds, add the following to your module-level <code>build.gradle</code> file:
شیار
android { ... buildTypes { debug { minifyEnabled true useProguard false } release { minifyEnabled true useProguard true // this is a default setting } } }
کاتلین
android { ... buildTypes { getByName("debug") { minifyEnabled = true useProguard = false } getByName("release") { minifyEnabled = true useProguard = true // this is a default setting } } }
</li> <li>Added logging support and improved performance for the resource shrinker. The resource shrinker now logs all of its operations into a <code>resources.txt</code> file located in the same folder as the Proguard log files. </li> </ul>
- Changed behavior:
- When
minSdkVersion
is set to 18 or higher, APK signing uses SHA256.
<li>DSA and ECDSA keys can now sign APK packages. <p class="note"> <strong>Note:</strong> The <a href= "/training/articles/keystore.html">Android keystore</a> provider no longer supports <a href= "/about/versions/marshmallow/android-6.0-changes.html#behavior-keystore"> DSA keys on Android 6.0</a> (API level 23) and higher. </p> </li> </ul>
- When
- Fixed issues:
- Fixed an issue that caused duplicate AAR dependencies in both the test and main build configurations.
Android plugin for Gradle, revision 1.5.0 (November 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Integrated the Data Binding plugin into the Android plugin for Gradle. To enable it, add the following code to each per-project
build.gradle
file that uses the plugin: - Added a new Transform API to allow third-party plugins to manipulate compiled
.class
files before they're converted to.dex
files. The Transform API simplifies injecting custom class manipulations while offering more flexibility regarding what you can manipulate. To insert a transform into a build, create a new class implementing one of theTransform
interfaces, and register it withandroid.registerTransform(theTransform)
orandroid.registerTransform(theTransform, dependencies)
. There's no need to wire tasks together. Note the following about the Transform API: - A transform can apply to one or more of the following: the current project, subprojects, and external libraries.
- A transform must be registered globally, which applies them to all variants.
- Internal code processing, through the Java Code Coverage Library (JaCoCo), ProGuard, and MultiDex, now uses the Transform API. However, the Java Android Compiler Kit (Jack) doesn't use this API: only the
javac/dx
code path does. - Gradle executes the transforms in this order: JaCoCo, third-party plugins, ProGuard. The execution order for third-party plugins matches the order in which the transforms are added by the third party plugins; third-party plugin developers can't control the execution order of the transforms through an API.
- Deprecated the
dex
getter from theApplicationVariant
class. You can't access theDex
task through the variant API anymore because it's now accomplished through a transform. There's currently no replacement for controlling the dex process. - Fixed incremental support for assets.
- Improved MultiDex support by making it available for test projects, and tests now automatically have the
com.android.support:multidex-instrumentation
dependency. - Added the ability to properly fail a Gradle build and report the underlying error cause when the Gradle build invokes asynchronous tasks and there's a failure in the worker process.
- Added support for configuring a specific Application Binary Interface (ABI) in variants that contain multiple ABIs.
- Added support for a comma-separated list of device serial numbers for the
ANDROID_SERIAL
environment variable when installing or running tests. - Fixed an installation failure on devices running Android 5.0 (API level 20) and higher when the APK name contains a space.
- Fixed various issues related to the Android Asset Packaging Tool (AAPT) error output.
- Added JaCoCo incremental instrumentation support for faster incremental builds. The Android plugin for Gradle now invokes the JaCoCo instrumenter directly. To force a newer version of the JaCoCo instrumenter, you need to add it as a build script dependency.
- Fixed JaCoCo support so it ignores files that aren't classes.
- Added vector drawable support for generating PNGs at build time for backward-compatibility. Android plugin for Gradle generates PNGs for every vector drawable found in a resource directory that doesn't specify an API version or specifies an
android:minSdkVersion
attribute of 20 or lower in the<uses-sdk>
element in the app manifest. You can set PNG densities by using thegeneratedDensities
property in thedefaultConfig
orproductFlavor
sections of abuild.gradle
file. - Added sharing of the mockable
android.jar
, which the plugin generates only once and uses for unit testing. Multiple modules, such asapp
andlib
, now share it. Delete$rootDir/build
to regenerate it. - Changed the processing of Java resources to occur before the obfuscation tasks instead of during the packaging of the APK. This change allows the obfuscation tasks to have a chance to adapt the Java resources following packages obfuscation.
- Fixed an issue with using Java Native Interface (JNI) code in the experimental library plugin.
- Added the ability to set the platform version separately from the
android:compileSdkVersion
attribute in the experimental library plugin.
android { dataBinding { enabled = true } }
android { dataBinding { enabled = true } }
- Integrated the Data Binding plugin into the Android plugin for Gradle. To enable it, add the following code to each per-project
Android plugin for Gradle, revision 1.3.1 (August 2015)
وابستگی ها:- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- Fixed the ZipAlign task to properly consume the output of the previous task when using a customized filename.
- Fixed Renderscript packaging with the NDK .
- Maintained support for the
createDebugCoverageReport
build task. - Fixed support for customized use of the
archiveBaseName
property in thebuild.gradle
build file. - Fixed the
Invalid ResourceType
lint warning caused by parameter method annotation lookup when running lint outside of Android Studio.
Android plugin for Gradle, revision 1.3.0 (July 2015)
وابستگی ها:- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
Added support for the
com.android.build.threadPoolSize
property to control theAndroid
task thread pool size from thegradle.properties
file or the command line. The following example sets this property to 4.-Pcom.android.build.threadPoolSize=4
- Set the default build behavior to exclude
LICENSE
andLICENSE.txt
files from APKs. To include these files in an APK, remove these files from thepackagingOptions.excludes
property in thebuild.gradle
file. به عنوان مثال:android { packagingOptions.excludes = [] }
android { packagingOptions.excludes.clear() }
- Added the
sourceSets
task to inspect the set of all available source sets. - Enhanced unit test support to recognize multi-flavor and build variant source folders. For example, to test an app with multi-flavors
flavor1
andflavorA
with theDebug
build type, the test source sets are:- تست کنید
- testFlavor1
- testFlavorA
- testFlavor1FlavorA
- testFlavor1FlavorADebug
Android tests already recognized multi-flavor source folders.
- Improved unit test support to:
- Run
javac
on main and test sources, even if theuseJack
property is set totrue
in your build file. - Correctly recognize dependencies for each build type.
- Run
- Added support for specifying instrumentation test-runner arguments from the command line. به عنوان مثال:
./gradlew connectedCheck \ -Pandroid.testInstrumentationRunnerArguments.size=medium \ -Pandroid.testInstrumentationRunnerArguments.class=TestA,TestB
Added support for arbitrary additional Android Asset Packaging Tool (AAPT) parameters in the
build.gradle
file. به عنوان مثال:android { aaptOptions { additionalParameters "--custom_option", "value" } }
android { aaptOptions { additionalParameters += listOf("--custom_option", "value") } }
- Added support for a test APK module as a separate test module, using the
targetProjectPath
andtargetVariant
properties to set the APK path and target variant.Note: A test APK module does not support product flavors and can only target a single variant. Also, Jacoco is not supported yet.
- Added resource name validation before merging resources.
- When building an AAR (Android ARchive) package for library modules, do not provide an automatic
@{applicationId}
placeholder in the manifest merger settings. Instead, use a different placeholder, such as@{libApplicationId}
and provide a value for it if you want to include application Ids in the archive library.
Android plugin for Gradle, revision 1.2.0 (April 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Enhanced support for running unit tests with Gradle.
- Added support to include Java-style resources in the classpath when running unit tests directly from Gradle.
- Added unit test dependency support for Android Archive (AAR) artifacts.
- Added support for the
unitTestVariants
property so unit test variants can be manipulated using thebuild.gradle
file. - Added the
unitTest.all
code block undertestOptions
to configure customized tasks for unit test. The following sample code shows how to add unit test configuration settings using this new option:android { testOptions { unitTest.all { jvmArgs '-XX:MaxPermSize=256m' // Or any other gradle option. } } }
android { testOptions { unitTest.all { jvmArgs += listOf("-XX:MaxPermSize=256m") // Or any other gradle option. } } }
- Fixed the handling of enums and public instance fields in the packaging of the
mockable-android.jar
file. - Fixed library project task dependencies so test classes recompile after changes.
- Added the
testProguardFile
property to apply ProGuard files when minifying a test APK. - Added the
timeOut
property to theadbOptions
code block for setting the maximum recording time for Android Debug Bridge screen recording. - Added support for 280 dpi resources.
- Improved performance during project evaluation.
- Enhanced support for running unit tests with Gradle.
Android plugin for Gradle, revision 1.1.3 (March 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Fixed issue with duplicated dependencies on a test app that triggered a ProGuard failure.
- Fixed Comparator implementation which did not comply with the JDK Comparator contract and generated a JDK 7 error.
Android plugin for Gradle, revision 1.1.2 (February 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Normalized path when creating a mockable JAR for unit testing.
- Fixed the
archivesBaseName
setting in thebuild.gradle
file. - Fixed the unresolved placeholder failure in manifest merger when building a library test application.
Android plugin for Gradle, revision 1.1.1 (February 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Modified build variants so only variants that package a Wear app trigger Wear-specific build tasks.
- Changed dependency related issues to fail at build time rather than at debug time. This behavior allows you to run diagnostic tasks (such as 'dependencies') to help resolve the conflict.
- Fixed the
android.getBootClasspath()
method to return a value.
Android plugin for Gradle, revision 1.1.0 (February 2015)
- وابستگی ها:
- Gradle 2.2.1 or higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Added new unit test support
- Enabled unit tests to run on the local JVM against a special version of the
android.jar
file that is compatible with popular mocking frameworks, for example Mockito. - Added new test tasks
testDebug
,testRelease
, andtestMyFlavorDebug
when using product flavors. - Added new source folders recognized as unit tests:
src/test/java/
,src/testDebug/java/
,src/testMyFlavor/java/
. - Added new configurations in the
build.gradle
file for declaring test-only dependencies, for example,testCompile 'junit:junit:4.11'
,testMyFlavorCompile 'some:library:1.0'
.Note: Test-only dependencies are not currently compatible with Jack (Java Android Compiler Kit).
- Added the
android.testOptions.unitTests.returnDefaultValues
option to control the behaviour of the mockable android.jar. - Replaced
Test
in test task names withAndroidTest
. For example, theassembleDebugTest
task is nowassembleDebugAndroidTest
task. Unit test tasks still haveUnitTest
in the task name, for exampleassembleDebugUnitTest
. - Modified ProGuard configuration files to no longer apply to the test APK. If minification is enabled, ProGuard processes the test APK and applies only the mapping file that is generated when minifying the main APK.
- Updated dependency management
- Fixed issues using
provided
andpackage
scopes.Note: These scopes are incompatible with AAR (Android ARchive) packages and will cause a build with AAR packages to fail.
- Modified dependency resolution to compare the dependencies of an app under test and the test app. If an artifact with the same version is found for both apps, it's not included with the test app and is packaged only with the app under test. If an artifact with a different version is found for both apps, the build fails.
- Fixed issues using
- Added support for
anyDpi
resource qualifier in resource merger. - Improved evaluation and IDE sync speeds for projects with a large number of Android modules .
Android plugin for Gradle, revision 1.0.1 (January 2015)
- وابستگی ها:
Gradle 2.2.1 up to 2.3.x.
Note: This version of the Android plugin for Gradle is not compatible with Gradle 2.4 and higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Fixed issue with Gradle build failure when accessing the
extractReleaseAnnotations
module. ( Issue 81638 ). - Fixed issue with
Disable
passing the--no-optimize
setting to the Dalvik Executable (dex) bytecode. ( Issue 82662 ). - Fixed manifest merger issues when importing libraries with a
targetSdkVersion
less than 16. - Fixed density ordering issue when using Android Studio with JDK 8.
- Fixed issue with Gradle build failure when accessing the
Android plugin for Gradle, revision 1.0.0 (December 2014)
- وابستگی ها:
Gradle 2.2.1 up to 2.3.x.
Note: This version of the Android plugin for Gradle is not compatible with Gradle 2.4 and higher.
- Build Tools 21.1.1 or higher.
- نکات کلی:
- Initial plugin release.