text
stringlengths
1
372
run flutter run --debug and select an android device:
when prompted, enter y.
the flutter tool enables multidex support and retries the build:
info note
multidex support is natively included when targeting
android SDK 21 or later. however, we don’t recommend
targeting API 21+ purely to resolve the multidex issue
as this might inadvertently exclude users running older devices.
you might also choose to manually support multidex by following android’s guides
and modifying your project’s android directory configuration.
a multidex keep file must be specified to include:
also, include any other classes used in app startup.
for more detailed guidance on adding multidex support manually,
check out the official android documentation.
<topic_end>
<topic_start>
reviewing the app manifest
review the default app manifest file, AndroidManifest.xml.
this file is located in [project]/android/app/src/main.
verify the following values:
<topic_end>
<topic_start>
reviewing the gradle build configuration
review the default gradle build file
(build.gradle, located in [project]/android/app),
to verify that the values are correct.
<topic_end>
<topic_start>
under the defaultConfig block
<topic_end>
<topic_start>
under the android block
for more information, check out the module-level build
section in the gradle build file.
<topic_end>
<topic_start>
building the app for release
you have two possible release formats when publishing to
the play store.
info note
the google play store prefers the app bundle format.
for more information, check out
about android app bundles.
<topic_end>
<topic_start>
build an app bundle
this section describes how to build a release app bundle.
if you completed the signing steps,
the app bundle will be signed.
at this point, you might consider obfuscating your dart code
to make it more difficult to reverse engineer. obfuscating
your code involves adding a couple flags to your build command,
and maintaining additional files to de-obfuscate stack traces.
from the command line:
the release bundle for your app is created at
[project]/build/app/outputs/bundle/release/app.aab.
by default, the app bundle contains your dart code and the flutter
runtime compiled for armeabi-v7a (arm 32-bit), arm64-v8a
(arm 64-bit), and x86-64 (x86 64-bit).
<topic_end>
<topic_start>
test the app bundle
an app bundle can be tested in multiple ways.
this section describes two.
<topic_end>
<topic_start>
offline using the bundle tool
<topic_end>
<topic_start>
online using google play
<topic_end>
<topic_start>
build an APK
although app bundles are preferred over APKs, there are stores
that don’t yet support app bundles. in this case, build a release
APK for each target ABI (application binary interface).
if you completed the signing steps, the APK will be signed.
at this point, you might consider obfuscating your dart code
to make it more difficult to reverse engineer. obfuscating
your code involves adding a couple flags to your build command.
from the command line:
enter cd [project].
run flutter build apk --split-per-abi.
(the flutter build command defaults to --release.)
this command results in three APK files:
removing the --split-per-abi flag results in a fat APK that contains
your code compiled for all the target ABIs. such APKs are larger in
size than their split counterparts, causing the user to download
native binaries that are not applicable to their device’s architecture.
<topic_end>
<topic_start>
install an APK on a device
follow these steps to install the APK on a connected android device.
from the command line:
<topic_end>
<topic_start>
publishing to the google play store
for detailed instructions on publishing your app to the google play store,
check out the google play launch documentation.
<topic_end>