เกี่ยวกับ Android App Bundle
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Android App Bundle เป็นรูปแบบการเผยแพร่ที่มีโค้ดและทรัพยากรที่คอมไพล์แล้วทั้งหมดของแอป และเลื่อนการสร้างและ Signing APK ไปยัง Google Play
Google Play ใช้ App Bundle ของคุณเพื่อสร้างและให้บริการ APK ที่เพิ่มประสิทธิภาพสำหรับการกำหนดค่าอุปกรณ์แต่ละรายการ ดังนั้นระบบจะดาวน์โหลดเฉพาะโค้ดและทรัพยากรที่จำเป็นสำหรับอุปกรณ์หนึ่งๆ เพื่อเรียกใช้แอปของคุณ คุณจึงไม่ต้องสร้าง ลงนาม และจัดการ APK หลายรายการเพื่อเพิ่มประสิทธิภาพการรองรับอุปกรณ์ต่างๆ อีกต่อไป และผู้ใช้จะดาวน์โหลดไฟล์ที่มีขนาดเล็กลงและเพิ่มประสิทธิภาพมากขึ้น
โปรเจ็กต์แอปส่วนใหญ่ไม่จําเป็นต้องทําอะไรมากนักเพื่อสร้าง App Bundle ที่รองรับการแสดง APK ที่เพิ่มประสิทธิภาพแล้ว หากคุณจัดระเบียบโค้ดและทรัพยากรของแอปตามแบบแผนที่กำหนดไว้แล้ว สร้าง Android App Bundle ที่ลงนามโดยใช้ Android Studio หรือใช้บรรทัดคำสั่ง และอัปโหลดไปยัง Google Play การแสดง APK ที่เพิ่มประสิทธิภาพจะกลายเป็นประโยชน์โดยอัตโนมัติ
เมื่อใช้รูปแบบ App Bundle เพื่อเผยแพร่แอป คุณยังเลือกใช้ประโยชน์จากการนำส่งฟีเจอร์ Play ได้ด้วย ซึ่งจะช่วยให้คุณเพิ่มโมดูลฟีเจอร์ลงในโปรเจ็กต์แอปได้
โมดูลเหล่านี้มีฟีเจอร์และทรัพยากรที่รวมอยู่ในแอปตามเงื่อนไขที่คุณระบุเท่านั้น หรือจะพร้อมให้ดาวน์โหลดในภายหลังเมื่อรันไทม์โดยใช้ไลบรารี Play Core ก็ได้
นักพัฒนาเกมที่เผยแพร่แอปด้วย App Bundle สามารถใช้ Play Asset Delivery ซึ่งเป็นโซลูชันของ Google Play สำหรับการนำส่งชิ้นงานเกมจำนวนมากที่มอบวิธีการนำส่งที่ยืดหยุ่นและประสิทธิภาพสูงให้แก่นักพัฒนาแอป
ดูภาพรวมของเหตุผลที่ควรเผยแพร่แอปโดยใช้ Android App Bundle ได้จากวิดีโอต่อไปนี้
ข้อจำกัดด้านขนาดการดาวน์โหลดที่บีบอัด
การเผยแพร่ด้วย Android App Bundle จะช่วยให้ผู้ใช้ติดตั้งแอปของคุณได้ด้วยการดาวน์โหลดที่มีขนาดเล็กที่สุดเท่าที่จะเป็นไปได้และเพิ่มขนาดการดาวน์โหลดที่บีบอัด
กล่าวคือ เมื่อผู้ใช้ดาวน์โหลดแอปของคุณ ขนาดรวมของ APK ที่บีบอัดซึ่งจําเป็นต่อการติดตั้งแอป (เช่น APK พื้นฐาน + APK การกําหนดค่า) ต้องไม่เกิน 4 GB การดาวน์โหลดที่ตามมา เช่น การดาวน์โหลดโมดูลฟีเจอร์ (และ APK การกำหนดค่า) ตามคำขอ จะต้องเป็นไปตามข้อจำกัดด้านขนาดการดาวน์โหลดที่บีบอัดนี้ด้วย Asset Pack จะไม่นับรวมในขีดจำกัดนี้ แต่จะมีข้อจำกัดด้านขนาดอื่นๆ
หาก Play Console พบว่าการดาวน์โหลดที่เป็นไปได้ของแอปหรือฟีเจอร์แบบออนดีมานด์มีขนาดใหญ่เกินขีดจำกัดขนาดสูงสุด คุณจะได้รับข้อผิดพลาด
โปรดทราบว่า Android App Bundle ไม่รองรับไฟล์สำหรับขยายของ APK (*.obb
) ดังนั้น หากคุณพบข้อผิดพลาดนี้เมื่อเผยแพร่ App Bundle ให้ใช้แหล่งข้อมูลอย่างใดอย่างหนึ่งต่อไปนี้เพื่อลดขนาดการดาวน์โหลด APK ที่บีบอัด
- ตรวจสอบว่าคุณได้เปิดใช้ APK การกำหนดค่าทั้งหมดโดยตั้งค่า
enableSplit = true
สำหรับ APK การกำหนดค่าแต่ละประเภท วิธีนี้ช่วยให้มั่นใจได้ว่าผู้ใช้จะดาวน์โหลดเฉพาะโค้ดและทรัพยากรที่จำเป็นต่อการใช้งานแอปในอุปกรณ์ของตน
- อย่าลืมลดขนาดแอปโดยนำโค้ดและทรัพยากรที่ไม่ได้ใช้งานออก
- ทำตามแนวทางปฏิบัติแนะนำเพื่อลดขนาดแอปให้น้อยลง
- ลองแปลงฟีเจอร์ที่ผู้ใช้บางรายใช้ไปเป็นโมดูลฟีเจอร์ที่แอปจะดาวน์โหลดในภายหลังได้ตามคําขอ โปรดทราบว่าวิธีนี้อาจต้องมีการปรับโครงสร้างแอปบางส่วน ดังนั้นโปรดลองใช้คำแนะนำอื่นๆ ที่อธิบายไว้ก่อน
ปัจจัยพิจารณาอื่นๆ
ต่อไปนี้เป็นปัญหาที่ทราบเมื่อสร้างหรือแสดงแอปด้วย Android App Bundle หากพบปัญหาที่ไม่ได้อธิบายไว้ที่นี่ โปรดรายงานข้อบกพร่อง
- การติดตั้งแอปที่โหลดจากแหล่งที่ไม่รู้จักบางส่วน ซึ่งก็คือแอปที่ไม่ได้ติดตั้งโดยใช้ Google Play Store และไม่มี APK แบบแยกที่จำเป็นอย่างน้อย 1 รายการ จะดำเนินการไม่สำเร็จในอุปกรณ์ที่ผ่านการรับรองจาก Google ทั้งหมดและอุปกรณ์ที่ใช้ Android 10 (API ระดับ 29) ขึ้นไป เมื่อดาวน์โหลดแอปผ่าน Google Play Store ทาง Google จะตรวจสอบว่าได้ติดตั้งคอมโพเนนต์ที่จำเป็นทั้งหมดของแอปแล้ว
หากคุณใช้เครื่องมือที่แก้ไขตารางทรัพยากรแบบไดนามิก APK ที่สร้างขึ้นจาก App Bundle อาจทำงานอย่างไม่คาดคิด ดังนั้นเมื่อสร้าง App Bundle เราขอแนะนำให้คุณปิดใช้เครื่องมือดังกล่าว
คุณสามารถกําหนดค่าพร็อพเพอร์ตี้ในการกําหนดค่าบิลด์ของโมดูลฟีเจอร์ที่ขัดแย้งกับพร็อพเพอร์ตี้จากโมดูลฐาน (หรือโมดูลอื่นๆ) ได้ เช่น คุณอาจตั้งค่าเป็น buildTypes.release.debuggable =
true
ในโมดูลพื้นฐานและตั้งค่าเป็น false
ในโมดูลฟีเจอร์
ข้อขัดแย้งดังกล่าวอาจทำให้เกิดปัญหาเกี่ยวกับบิลด์และรันไทม์ โปรดทราบว่าโดยค่าเริ่มต้นแล้ว โมดูลฟีเจอร์จะรับค่ากําหนดการสร้างบางอย่างมาจากโมดูลฐาน ดังนั้น โปรดตรวจสอบว่าคุณเข้าใจว่าควรเก็บการกำหนดค่าใดไว้และควรละเว้นการกำหนดค่าใดในการกำหนดค่าการสร้างโมดูลฟีเจอร์
แหล่งข้อมูลเพิ่มเติม
ดูข้อมูลเพิ่มเติมเกี่ยวกับ Android App Bundle ได้ที่แหล่งข้อมูลต่อไปนี้
บล็อกโพสต์
วิดีโอ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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)"]]