Build Unsigned Apk File With Android Studio

Contents Signing the appReviewing the Gradle build configurationBuilding the phầm mềm for releaseTest the app bundleAndroid release FAQ

During a typical development cycle,you kiểm tra an ứng dụng using run at the command line,or by using the Run & Debugoptions in your IDE. By mặc định, builds a debug version of your tiện ích.

Bạn đang xem: Build unsigned apk file with android studio

When you’re ready to prepare a release version of your ứng dụng,for example lớn publish to lớn the Google Play Store,this page can help. Before publishing,you might want to put some finishing touches on your tiện ích.This page covers the following topics:

Note: Throughout this page, refers to the directory that your application is in. While following these instructions, substitute with your app’s directory.

Adding a launcher icon

When a new tiện ích is created, it has a default launcher icon.To customize this icon, you might want lớn check out thedaichiensk.com_launcher_icons package.

Alternatively, you can vì chưng it manually using the following steps:

To verify that the icon has been replaced,run your app and inspect the phầm mềm icon in the Launcher.

Enabling Material Components

If your ứng dụng uses Platform Views, you may want khổng lồ enableMaterial Components by following the steps described in theGetting Started guide for Android.

For example:

Add the dependency on Android’s Material in /android/app/build.gradle:

dependencies // ... implementation "" // ...
To find out the lakiểm tra version, visit Google Maven.

Set the light theme in /android/app/src/main/res/values/styles.xml:

Set the dark theme in /android/app/src/main/res/values-night/styles.xml

Signing the app

To publish on the Play Store, you need to lớn give sầu your ứng dụng a digitalsignature. Use the following instructions to sign your ứng dụng.

On Android, there are two signing keys: deployment và upload. The end-users download the .app android signed with the ‘deployment key’. An ‘upload key’ is used lớn authenticate the .aab / .app android uploaded by developers onkhổng lồ the Play Store & is re-signed with the deployment key once in the Play Store.

Create an upload keystore

If you have an existing keystore, skip khổng lồ the next step.If not, create one by either:

Running the following at the comm& line:

On Mac/Linux, use the following command:

keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
On Windows, use the following command:

keytool -genkey -v -keystore c:UsersUSER_NAMEupload-keystore.jks -storetype JKS -keyalg RSA -keykích cỡ 2048 -validity 10000 -alias upload
This commvà stores the upload-keystore.jks tệp tin in your trang chủ directory. If you want khổng lồ store it elsewhere, change the argument you pass lớn the -keystore parameter. However, keep the keystore file private; don’t kiểm tra it into public source control!


The keytool command might not be in your path—it’spart of Java, which is installed as part ofAndroid Studio. For the concrete path,run doctor -v and locate the path printed after‘Java binary at:’. Then use that fully qualified pathreplacing java (at the end) with keytool.If your path includes space-separated names,such as Program Files, use platform-appropriatenotation for the names. For example, on Mac/Linuxuse Program Files, & on Windows use"Program Files".

The -storetype JKS tag is only required for Java 9or newer. As of the Java 9 release,the keystore type defaults lớn PKS12.

Reference the keystore from the app

Create a tệp tin named /android/key.propertiesthat contains a reference to lớn your keystore:

Warning: Keep the tệp tin private; don’t check it inkhổng lồ public source control.

Configure signing in gradle

Configure gradle lớn use your upload key when building your tiện ích in release mode by editing the /android/app/build.gradle file.

Add the keystore information from your properties file before the game android block:

def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file("") if (keystorePropertiesFile.exists()) keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) game android ...
Load the file into the keystoreProperties object.

Find the buildTypes block:

buildTypes release // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, // so ` run --release` works. signingConfig signingConfigs.debug
And replace it with the following signing configuration info:

signingConfigs release keyAlias keystoreProperties<"keyAlias"> keyPassword keystoreProperties<"keyPassword"> storeFile keystoreProperties<"storeFile"> ? file(keystoreProperties<"storeFile">) : null storePassword keystoreProperties<"storePassword"> buildTypes release signingConfig signingConfigs.release
Release builds of your ứng dụng will now be signed automatically.

Note: You may need lớn run clean after changing the gradle tệp tin. This prevents cached builds from affecting the signing process.

For more information on signing your app, seeSign your ứng dụng on

Shrinking your code with R8

R8 is the new code shrinker from Google, & it’s enabled by defaultwhen you build a release APK or AAB. To disable R8, pass the --no-shrinkflag to lớn build game android or build appbundle.

Note: Obfuscation & minification can considerably extover compile time of the Android application.

Enabling multidex support

When writing large apps or making use of large plugins, you may encounterAndroid’s dex limit of 64k methods when targeting a minimum API of trăng tròn orbelow. This may also be encountered when running debug versions of your appvia run that does not have sầu shrinking enabled. tool supports easily enabling multidex. The simplest way is toopt inkhổng lồ multidex support when prompted. The tool detects multidex build errors& will ask before making changes to lớn your Android project. Opting in to lớn automatically depkết thúc on androidx.multidex:multidex & use agenerated daichiensk.comMultiDexApplication as the project’s application.

Note: Multidex tư vấn is natively included when targeting min sdk 21+.

You might also choose khổng lồ manually support multidex by following Android’s guides& modifying your project’s Android directory configuration. Amultidex keep tệp tin must be specified to include:

Also, include any other classes used in ứng dụng startup.See the official Android documentation for more detailedguidance on adding multidex support manually.

Reviewing the app manifest

reviews the mặc định App Manifest file,AndroidManifest.xml,located in /android/app/src/main and verify that the valuesare correct, especially the following:

application Edit the android:label in theapplication tag to lớn reflectthe final name of the ứng dụng. uses-permission Add the app android.permission.INTERNETpermission if your application code needs Internetaccess. The standard template does not include this tag but allowsInternet access during development to enable communication tools & a running app.

Reviewing the Gradle build configuration

nhận xét the default Gradle build tệp tin (build.gradle) located in /android/app lớn verify the values are correct:

Under the defaultConfig block applicationId Specify the final, quality application ID minSdkVersion Specify the minimum API màn chơi on which the ứng dụng is designed lớn run.Defaults to lớn targetSdkVersion Specify the target API level on which the ứng dụng is designed lớn run.Defaults lớn versionCode A positive sầu integer used as an internal version number. This numberis used only lớn determine whether one version is more recent thananother, with higher numbers indicating more recent versions.This version isn’t shown to users. versionName A string used as the version number shown to users. This settingcan be specified as a raw string or as a reference to a string resource. buildToolsVersion If you’re using Android plugin for Gradle 3.0.0 or higher, your projectautomatically uses the default version of the build tools that theplugin specifies. Alternatively, you can specify a version of the build tools.Under the apk bloông xã compileSdkVersion Specify the API level Gradle should use to compile your ứng dụng.Defaults to

For more information, see the module-level build section in the Gradle build file.

Xem thêm: Agony Là Gì - Agony Tiếng Anh Là Gì

Building the ứng dụng for release

You have two possible release formats when publishing tothe Play Store.

App bundle (preferred) APK

Note: The Google Play Store prefers the ứng dụng bundle format. For more information, see Android App Bundle & About Android App Bundles.

Warning: Recently, the team has received several reports from developers indicating they are experiencing phầm mềm crashes on certain devices on Android 6.0. If you are targeting Android 6.0, use the following steps:

If you build an App BundleEdit android/ and add the flag:game android.bundle.enableUncompressedNativeLibs=false.

If you build an APKMake sure android/app/src/AndroidManifest.xmldoesn’t mix android:extractNativeLibs=falsein the tag.

For more information, see the public issue.

Build an tiện ích bundle

This section describes how to build a release app bundle.If you completed the signing steps,the ứng dụng bundle will be signed.At this point, you might consider obfuscating your Dart codekhổng lồ make it more difficult lớn reverse engineer. Obfuscatingyour code involves adding a couple flags khổng lồ your build commvà,và maintaining additional files lớn de-obfuscate stachồng traces.

From the comm& line:

Enter cd Run build appbundle(Running build defaults to a release build.)

The release bundle for your phầm mềm is created at/build/app/outputs/bundle/release/app.aab.

By default, the phầm mềm bundle contains your Dart code and the daichiensk.comruntime compiled for armeabi-v7a (ARM 32-bit), arm64-v8a(ARM 64-bit), & x86-64 (x86 64-bit).

Test the ứng dụng bundle

An tiện ích bundle can be tested in multiple ways—this sectiondescribes two.

Offline using the bundle tool Online using Google Play Upload your bundle lớn Google Play to lớn kiểm tra it.You can use the internal demo traông chồng,or the alpha or beta channels lớn chạy thử the bundle beforereleasing it in production.

Build an APK

Although app bundles are preferred over APKs, there are storesthat don’t yet tư vấn app bundles. In this case, build a releaseAPK 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 codeto lớn make it more difficult to lớn reverse engineer. Obfuscatingyour code involves adding a couple flags to your build command.

From the command line:

Enter cd Run build apk --split-per-abi(The build commvà defaults to lớn --release.)

This comm& results in three APK files:

/build/app/outputs/apk/release/ android /build/app/outputs/apk/release/ android /build/app/outputs/apk/release/app-x86_64-release.apk

Removing the --split-per-abi flag results in a fat APK that containsyour code compiled for all the target ABIs. Such APKs are larger insize than their split counterparts, causing the user to lớn downloadnative binaries that are not applicable to their device’s architecture.

Install an APK on a device

Follow these steps khổng lồ install the APK on a connected Android device.

From the commvà line:

Connect your Android device to lớn your computer with a USB cable. Enter cd . Run install.

Publishing lớn the Google Play Store

For detailed instructions on publishing your tiện ích lớn the Google Play Store,see the Google Play launch documentation.

Updating the app’s version number

The default version number of the tiện ích is 1.0.0.To update it, navigate to lớn the pubspec.yaml file& update the following line:

version: 1.0.0+1

The version number is three numbers separated by dots,such as 1.0.0 in the example above sầu, followed by an optionalbuild number such as 1 in the example above, separated by a +.

Both the version và the build number may be overridden in’sbuild by specifying --build-name và --build-number, respectively.

In Android, build-name is used as versionName whilebuild-number used as versionCode. For more information,see Version your tiện ích in the Android documentation.

After updating the version number in the pubspec tệp tin,run pub get from the top of the project, oruse the Pub get button in your IDE. This updatesthe versionName and versionCode in the file,which are later updated in the build.gradle file when yourebuild the tiện ích.

Android release FAQ

Here are some commonly asked questions about deployment forAndroid apps.

When should I build ứng dụng bundles versus APKs?

The Google Play Store recommends that you deploy tiện ích bundlesover APKs because they allow a more efficient delivery of theapplication to lớn your users. However, if you’re distributingyour application by means other than the Play Store,an APK may be your only option.

What is a fat APK?

A fat APK is a single APK that contains binaries for multipleABIs embedded within it. This has the benefit that the single APKruns on multiple architectures và thus has wider compatibility,but it has the drawbachồng that its file kích thước is much larger,causing users lớn tải về và store more bytes when installingyour application. When building APKs instead of phầm mềm bundles,it is strongly recommended to lớn build split APKs,as described in build an APK using the--split-per-abi flag.

What are the supported target architectures?

When building your application in release mode, apps can be compiled for armeabi-v7a (ARM 32-bit),arm64-v8a (ARM 64-bit), & x86-64 (x86 64-bit) does not currently support building for x86 Android(See Issue 9253).

How vày I sign the ứng dụng bundle created by build appbundle?

See Signing the phầm mềm.

How vì I build a release from within Android Studio?

In Android Studio, open the existing android/folder under your app’s folder. Then,select build.gradle (Module: app) in the project panel:


Next, select the build variant. Click Build > Select Build Variantin the main menu. Select any of the variants in the Build Variantspanel (debug is the default):


The resulting app bundle or APK files are located inbuild/app/outputs within your app’s folder.

link tải 567 live app | W88Vuive | F8bet|xo so ket qua| tải app qqlive apk | jun88