以下內容來自 https://developer.android.com/studio/build/shrink-code 僅供參考 ————— To make your APK file as small as possible, you should enable shrinking to remove unused code and resources in your release build. This page describes how to do that and how to specify what code and resources to keep or discard during the build. 要使您的APK文件盡可能小,您應該啟用收縮以刪除發布版本中未使用的代碼和資源。 此頁面介紹瞭如何執行此操作以及如何指定在構建期間要保留或丟棄的代碼和資源。 要讓 APK 檔案體積儘可能的小,在以發佈為目的的建構中可以開啟精簡功能來移除未使用的程式碼與資源。本頁說明其操作的方式,以及在建構的過程中,如何指定要保留或捨棄的資源與程式碼。 ————— Code shrinking is available with ProGuard , which detects and removes unused classes, fields, methods, and attributes from your packaged app, including those from included code libraries (making it a valuable tool for working around the 64k reference limit ). ProGuard also optimizes the bytecode, removes unused code instructions, and obfuscates the remaining classes, fields, and methods with short names. ProGuard提供代碼縮減功能,可以從打包的應用程序中檢測並刪除未使用的類,字段,方法和屬性,包括來自所包含代碼庫的那些(使其成為處理64k參考限制的有用