different API version number behind the Build-tools! ①buildetoolversion is the version of your build tool, and this version is typically api-level.0.0. For example, the I/O2014 conference released the API20 corresponding to the Build-tool version is 20.0.0, there may be a small version between this, such as 20.0.1 and so on.② can be set sdk.buildtools=20.0.0 in the project.properties of Ecplise. You can also not set, if not set to specify the latest version. And in Android Studio, it must be se
. gradle of the app module. It will be automatically generated to AndroidMainfest. xml during compilation. You can directly open gs-target-setting/app/build/intermediates/manifests/full/debug/AndroidMainfest. xml for viewing.
If you declare it directly in AndroidMainfest. xml, it will be ignored during compilation, and the original value will be overwritten Based on build. gradle.
All right, we all know that the uses-sdk tag contains three attributes: minSd
People who have done larger projects know that when the app is large to a certain extent, there will be 65535 this error, that is, 64K, that is, an app package, the number of methods can not exceed 65,535, more than will be divided into several Dex package, this individual asked why, Android restrictions. Can also be understood as a "Bug" for Android.The Eclipse era, in order to solve this problem, is actually very painful, but it doesn't matter, now there is Android Studio, this problem is solv
://gist.github.com/youxiachai/5608223 Https://github.com/ShinChven/ImmigrateToGradle Http://avatarqing.github.io/Gradle-Plugin-User-Guide-Chinese-Verision/introduction/README.html Here is the configuration information I used for the Gradle, which is under the main project, that is, the above 2 places In addition, 1 configuration items in the default, because some of the library project default maven ( the default is this jcenter ()) warehouse is not found, so I added aMavencentral () Apply plugi
files and code.
Note: If our project minsdkversion is 20 or lower, run to the Android 4.4 (API leve 20) or a lower version of the device, you need to disable Androidstudio for immediate operation
II, Android 5.0 and later
Android 5.0 (API leve 21) and higher system use runtime is art, native support loads multiple Dex files from the applied apk file. Art compiles applications when the application is installed, scanning multiple classes (... N). de
in Androidmenifest.xml, there are often the following statements:
Copy Code code as follows:
Android:targetsdkversion= "10"
android:maxsdkversion= "Ten"/>
In Default.properties, you see the following statement:
Target=android-10
If you are using Eclipse, you may also see a warning like this:
Attribute Minsdkversion (4) is lower than the project target API level (10)
So what's the difference between the
In androidmenifest. XML, the following statements are often used: In default. properties, the following statement is displayed: Target = Android-10 If you are using eclipse, you may also see the warning that attribute minsdkversion (4) is lower than the project target API level (10) So what are the differences between the minsdkversion, targetsdkversion, maxsdkversion, and target API level values?
loop thread, but does not encourage this. It should be placed in a sub-thread, and then broadcast when the child thread is finished, message, notify the main thread to make the corresponding UI change, or use Asynctask to do the network operation. This issue involves the SDK version configuration in the Androidmanifest.xml file, and as Android Studio defaults to compiling with Gradle, Build.gradle file also has the corresponding SDK version configuration, so how to properly configure these SDK
app, use SDK Manager to update Android SDKBuild Tools and Android Support Repository to the latest version.
Before using multidex configuration in your app, you need to make some modifications to your program development. Follow these steps:
1. Modify Your Gradle build configuration to enable multidex
2. Modify Your AndroidManifest to reference the MultiDexApplication class.
Modify the build. gradle configuration to reference the support library and enable multidex output, as shown in the follo
conflict. Conflict markers and selectors can also define custom merging rules. For example, a database that allows an import has a minSdkVersion greater than the version defined in other higher-priority lists.
The list merging priority determines which list settings are retained in the merge conflicts. Use the high-priority order file settings to overwrite the low-priority list. The following list details which configuration sets the highest priori
In AndroidMenifest. xml, the following statements are often used:
Copy codeThe Code is as follows: Android: targetSdkVersion = "10"
Android: maxSdkVersion = "10"/>
In default. properties, the following statement is displayed:Target = android-10If you are using Eclipse, you may also see the following warning:Attribute minSdkVersion (4) is lower than the project target API level (10)
So what are the differences between the
Build Tool 21.1.
Set your application development project to use the multidex configuration, requiring you to make some modifications to your application development project. :
Modify the configuration of Gradle. multidex is supported.
Modify your manifest. Make it support the multidexapplication class
Modify the Gradle build as follows:
android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { ... minSdkVersion
tasks.
The method for executing a task isGradle Task Name, Suchgradle assemble
In the android project, there is connectedCheck (check the connected device or simulator) and deviceCheck (check the api version used by the device)
Generally, our project generates at least two versions, debug and release. We can use two tasks, assembleDebug and assumerelease, to generate two versions respectively. We can also use assemble to generate two versions at once.
Gradle supports the abbreviated
above system and 5.0 below system how to do. Sir do not worry, first look at my analysis of reasons, after all, I want to install forced haha.One, Android version 5.0 or lessSystems prior to Android 5.0 (API leve 21) Use Dalvik to execute application code. By default, Dalvik restricts an apk to only one Dex file. To circumvent this limitation, we can use the Multidex support library, which becomes part of our apk's main dex file and is responsible for managing our APK access to other Dex files
attribute (high priority to low).
The main manifest file for the application module
Manifest files in the included libraries: if there are multiple libraries, the manifest priority matches the order of dependencies (the order in which the libraries appear in the Gradle dependencies block).
Important: The build configuration in the Build.gradle file replaces any corresponding attribute in the merged manifest file. The minsdkversion in the
65K
When you are sure to use the multidex subcontracting policy, please first determine that your code is excellent. You also need to perform the following steps:Remove unused import and library use ProGuard to Remove unused code
Use Gradle to configure Multidex
Android's Gradle plug-in supports multidex since Android Build Tool 21.1.
Set your application development project to use the multidex configuration, requiring you to make some modifications to your application development project. :Mod
This afternoon when learning about Android development, when learning to develop a GridView in the documentation, debug the program on the emulator everything is OK, as shown in:However, when the bin directory under the hellogridview.apk copy to the M8 Android installation, there is a "parsing package error" prompt, after the online search for answers, after the comparison with the previous example, found that I was in the creation of Android project, Since the SDK used is version 2.3.3, the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.