מידע על קובצי Android App Bundle
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Android App Bundle הוא פורמט פרסום שכולל את כל המשאבים והקוד המקודד של האפליקציה, ומעביר את היצירה והחתימה של ה-APK ל-Google Play.
Google Play משתמש בקובץ ה-App Bundle כדי ליצור ולספק חבילות APK שעברו אופטימיזציה לכל תצורת מכשיר, כך שרק הקוד והמשאבים הנדרשים למכשיר ספציפי ייורדו כדי להפעיל את האפליקציה. כבר לא צריך ליצור, לחתום ולנהל כמה חבילות APK כדי לבצע אופטימיזציה לתמיכה במכשירים שונים, והמשתמשים מקבלים הורדות קטנות יותר שעברו אופטימיזציה.
ברוב פרויקטי האפליקציות לא יהיה צורך בהרבה מאמץ כדי ליצור חבילות אפליקציות שתומכות בהצגת חבילות APK שעברו אופטימיזציה. אם כבר מארגנים את הקוד והמשאבים של האפליקציה בהתאם למוסכמות המקובלות, יוצרים חבילות Android App Bundle חתומות באמצעות Android Studio או באמצעות שורת הפקודה, ומעלים אותן ל-Google Play, היתרון של הצגת חבילות APK שעברו אופטימיזציה יהפוך לאוטומטי.
כשמשתמשים בפורמט של חבילת האפליקציות כדי לפרסם את האפליקציה, אפשר גם להשתמש ב-Play Feature Delivery, שמאפשר להוסיף מודולים של תכונות לפרויקט האפליקציה.
המודולים האלה מכילים תכונות ומשאבים שכלולים באפליקציה רק על סמך תנאים שתציינו, או שיהיו זמינים להורדה מאוחר יותר בסביבת זמן הריצה באמצעות ספריית הליבה של Google Play.
מפתחי משחקים שמפרסמים את האפליקציות שלהם בחבילות אפליקציות יכולים להשתמש ב-Play Asset Delivery: הפתרון של Google Play להעברת כמויות גדולות של נכסי משחקים, שמציע למפתחים שיטות העברה גמישות וביצועים גבוהים.
בסרטון הבא מוסבר למה כדאי לפרסם את האפליקציה באמצעות קובצי Android App Bundle.
הגבלת גודל הורדה דחוסה
פרסום באמצעות Android App Bundles עוזר למשתמשים להתקין את האפליקציה באמצעות הורדות קטנות ככל האפשר, ומגדיל את גודל ההורדה הדחוס.
כלומר, כשמשתמש מוריד את האפליקציה, הגודל הכולל של חבילות ה-APK הדחוסות הנדרשות להתקנה שלה (לדוגמה, קובץ ה-APK הבסיסי וחבילות ה-APK של ההגדרות) לא יכול לחרוג מ-4GB. כל הורדה שתתבצע לאחר מכן, כמו הורדה של מודול תכונה (וחבילות ה-APK של ההגדרות שלו) על פי דרישה, חייבת גם לעמוד במגבלה הזו לגבי גודל ההורדה הדחוסה. חבילות נכסים לא נכללות במגבלת הגודל הזו, אבל הן כפופות למגבלות גודל אחרות.
אם מערכת Play Console תזהה שהאפליקציה או התכונות שלה על פי דרישה גדולות מהמגבלות המקסימליות לגודלם, תופיע הודעת שגיאה.
חשוב לזכור שקובצי Android App Bundle לא תומכים בקובצי הרחבה של APK (*.obb
). לכן, אם אתם נתקלים בשגיאה הזו כשאתם מפרסמים את חבילת האפליקציות, תוכלו להיעזר באחד מהמקורות הבאים כדי לצמצם את גודל ההורדה של חבילות ה-APK הדחוסות:
- חשוב להפעיל את כל חבילות ה-APK של התצורה על ידי הגדרת
enableSplit = true
לכל סוג של חבילת APK של תצורה. כך המשתמשים מורידים רק את הקוד והמשאבים הנדרשים להפעלת האפליקציה במכשיר שלהם.
- חשוב לצמצם את האפליקציה על ידי הסרת קוד ומשאבים שלא נמצאים בשימוש.
- כדאי לפעול לפי השיטות המומלצות כדי להקטין עוד יותר את נפח האפליקציה.
- מומלץ להמיר תכונות שרק חלק מהמשתמשים משתמשים בהן למודולים של תכונות, שהאפליקציה תוכל להוריד מאוחר יותר, על פי דרישה. חשוב לזכור שיכול להיות שתצטרכו לבצע קצת רפאקציה של האפליקציה, לכן חשוב לנסות קודם את ההצעות האחרות שמפורטות כאן.
שיקולים נוספים
הבעיות הבאות ידועות כשמפתחים או מציגים את האפליקציה באמצעות חבילות App Bundle ל-Android. אם נתקלת בבעיות שלא מתוארות כאן, אפשר לדווח על באג.
- התקנות חלקיות של אפליקציות שהותקנו ממקור לא ידוע – כלומר אפליקציות שלא הותקנו באמצעות חנות Google Play וחסרים להן קובצי APK מחולקים נדרשים אחד או יותר – נכשלות בכל המכשירים המאושרים על ידי Google ובמכשירים עם Android מגרסה 10 (רמת API 29) ואילך. כשמורידים את האפליקציה דרך חנות Google Play, Google מוודאת שכל הרכיבים הנדרשים של האפליקציה מותקנים.
אם אתם משתמשים בכלים שמבצעים שינויים דינמיים בטבלאות המשאבים, יכול להיות שחבילות ה-APK שנוצרות מחבילות האפליקציות יפעלו באופן בלתי צפוי. לכן, כשמפתחים חבילת אפליקציות, מומלץ להשבית כלים כאלה.
אפשר להגדיר מאפיינים בהגדרות ה-build של מודול התכונה, שיהיו בסתירה למאפיינים של המודולים הבסיסיים (או מודולים אחרים). לדוגמה, אפשר להגדיר את buildTypes.release.debuggable =
true
במודול הבסיס ולהגדיר אותו כ-false
במודול התכונות.
קונפליקטים כאלה עלולים לגרום לבעיות בזמן ה-build ובזמן הריצה. חשוב לזכור שמודולים של תכונות יורשים כברירת מחדל חלק מתצורות ה-build מהמודול הבסיסי. לכן, חשוב להבין אילו הגדרות צריך לשמור ואילו להוציא מהגדרת ה-build של מודול התכונה.
מקורות מידע נוספים
מידע נוסף על חבילות אפליקציות ל-Android זמין במשאבים הבאים.
פוסטים בבלוג
סרטונים
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# About Android App Bundles\n\n| **Important:** From August 2021, new apps are required to publish with the [Android App Bundle](/guide/app-bundle) on Google Play. New apps larger than 200 MB are now supported by either [Play Feature Delivery](/guide/app-bundle/dynamic-delivery) or [Play Asset Delivery](/guide/app-bundle/asset-delivery). From June 2023, new and existing [TV apps are required to\n| be published as App Bundles](/docs/quality-guidelines/tv-app-quality#SC-E1).\n\nAn *Android App Bundle* is a publishing format that includes all your app's\ncompiled code and resources, and defers APK generation and signing to Google\nPlay.\n\nGoogle Play uses your app bundle to generate and serve optimized APKs for each\ndevice configuration, so only the code and resources that are needed for a\nspecific device are downloaded to run your app. You no longer have to build,\nsign, and manage multiple APKs to optimize support for different devices, and\nusers get smaller, more-optimized downloads.\n\nMost app projects won't require much effort to build app bundles that support\nserving optimized APKs. If you already [organize your app's code and\nresources](/guide/topics/resources/providing-resources#AlternativeResources)\naccording to established conventions, [build signed Android App\nBundles](/studio/publish/app-signing#sign-apk) using Android Studio or by [using\nthe command line](/studio/build/building-cmdline), and [upload them to Google\nPlay](/studio/publish/upload-bundle), then optimized APK serving becomes an\nautomatic benefit.\n\nWhen you use the app bundle format to publish your app, you can also optionally\ntake advantage of [Play Feature Delivery](/guide/playcore/feature-delivery),\nwhich lets you add *feature modules* to your app project.\nThese modules contain features and resources that are only included with your\napp based on conditions that you specify, or are available later at runtime for\ndownload [Using the Play Core Library](/guide/playcore).\n\nGame developers who publish their apps with app bundles can use\n[Play Asset Delivery](/guide/playcore/asset-delivery): Google Play's solution\nfor delivering large amounts of game assets that offers developers flexible\ndelivery methods and high performance.\n\nWatch the following video for an overview of why you should publish your app\nusing Android App Bundles. \n\nCompressed download size restriction\n------------------------------------\n\nPublishing with Android App Bundles helps your users to install your app with\nthe smallest downloads possible and increases the **compressed download size** .\nThat is, when a user downloads your app, the total size of\nthe compressed APKs required to install your app (for example, the base APK +\nconfiguration APKs) must be no more than 4 GB. Any subsequent downloads,\nsuch as downloading a feature module (and its configuration APKs) on demand,\nmust also meet this compressed download size restriction. Asset packs don't\ncontribute to this size limit, but they do have other [size restrictions](/guide/app-bundle/asset-delivery#size-limits).\n\nIf the Play Console finds any of the possible downloads of your app or its on\ndemand features to be more than the [maximum size limits](https://support.google.com/googleplay/android-developer/answer/9859372#size_limits), you will get an error.\n\nKeep in mind, **Android App Bundles do not support APK expansion (`*.obb`)\nfiles**. So, if you encounter this error when publishing your app bundle, use\none of the following resources to reduce compressed APK download sizes:\n\n- Make sure you [enable all configuration APKs](/studio/projects/dynamic-delivery#disable_config_apks) by setting `enableSplit = true` for each type of configuration APK. This makes sure that users download only the code and resources they need to run your app on their device.\n- Make sure you [shrink your app](/studio/build/shrink-code) by removing unused code and resources.\n- Follow best practices to further [reduce app size](/topic/performance/reduce-apk-size).\n- Consider converting features that are used by only some of your users into [feature modules](/studio/projects/dynamic-delivery#dynamic_feature_modules) that your app can download later, on demand. Keep in mind, this may require some refactoring of your app, so make sure to first try the other suggestions described.\n\nOther considerations\n--------------------\n\nThe following are known issues when building or serving your app\nwith Android App Bundles. If you experience issues that are\nnot already described here, [report a bug](https://issuetracker.google.com/issues/new?component=398856&template=1084213).\n\n- Partial installs of sideloaded apps---that is, apps that are not installed using the Google Play Store and are missing one or more required split APKs---fail on all Google-certified devices and devices running Android 10 (API level 29) or higher. When downloading your app through the Google Play Store, Google ensures that all required components of the app are installed.\n- If you use tools that dynamically modify resource tables, APKs generated\n from app bundles might behave unexpectedly. So, when building an app bundle,\n it is recommended that you disable such tools.\n\n- It is possible to configure properties in a feature\n module's build configuration that conflict with those from the base (or\n other) modules. For example, you can set `buildTypes.release.debuggable =\n true` in the base module and set it to `false` in a feature module.\n Such conflicts might cause build and runtime issues. Keep in mind, by default,\n feature modules inherit some build configurations from the base\n module. So, make sure you understand which configurations you should keep,\n and which ones you should omit, in your [feature module build\n configuration](/guide/app-bundle/configure#feature_build_config).\n\nAdditional resources\n--------------------\n\nTo learn more about Android App Bundles, consult the following resources.\n\n### Blog posts\n\n- [Building your first App Bundle](https://medium.com/androiddevelopers/building-your-first-app-bundle-bbcd228bf631)\n- [What a new publishing format means for the future of Android](https://medium.com/googleplaydev/what-a-new-publishing-format-means-for-the-future-of-android-2e34981793a)\n- [New features to help you develop, release, and grow your business on Google Play](https://android-developers.googleblog.com/2019/05/whats-new-in-play.html)\n- [The latest Android App Bundle updates including the additional languages API](https://android-developers.googleblog.com/2019/03/the-latest-android-app-bundle-updates.html)\n- [Patchwork Plaid --- A modularization story](https://medium.com/androiddevelopers/a-patchwork-plaid-monolith-to-modularized-app-60235d9f212e)\n- [Google Santa Tracker --- Moving to an Android App Bundle](https://medium.com/androiddevelopers/google-santa-tracker-moving-to-an-android-app-bundle-dde180716096)\n- [Developer tools on Play Console](https://medium.com/androiddevelopers/developer-tools-on-play-store-85fb710ee33b)\n\n### Videos\n\n- [Everything to know about Play App Signing](https://www.youtube.com/watch?v=odv_1fxt9BI)\n- [Building your first App Bundle](https://www.youtube.com/watch?v=IPLhLu0kvYw)\n- [App Bundles: Testing with Bundletool and the Play Console](https://www.youtube.com/watch?v=vAEAZPU7w-I)\n- [Customizable Delivery with the App Bundle and Easy Sharing of Test Builds](https://www.youtube.com/watch?v=flhib2krW7U)\n- [New Tools to Optimize Your App's Size and Boost Installs on Google Play](https://www.youtube.com/watch?v=rEuwVWpYBOY)"]]