12th of Android highlights: INSTALL_FAILED_OLDER_SDK,
The error description is as follows:
$ Adb install./app/build/outputs/apk/app-debug.apk2999 KB/s (8256380 bytes in 2.688 s) pkg:/data/local/tmp/app-debug.apkFailure [INSTALL_FAILED_OLDER_SDK]
The reason is that the Android version of your device is too low and the app does not support it.The correct method is to increase the minimum version number in the Manifest file (or build. gradle) of the program.In Manifest:
In build. gradle:
De
android3.0Enable Action Bar
1. Action Bar on devices AFTER Android 3.0 (API 11)Starting from Android 3.0, the Action bar is included in the Activity with the Theme. Holo topic used (Or a subclass of Theme. Holo.) Theme. Holo is the default topic. When both minSdkVersion and targetSdkVersion are 11 or later.2. Action Bar on devices BEFORE Android 3.0 (API 11)Must be a device of more than 2.1, You need to include the Support Library (android-support-v7
Android uses Gradle to release multi-channel versions.
Today, when I published a multi-channel version through Gradle, I encountered the problem that the Gradle version was too low, and the manifestPlaceholders field was not supported. I tried every means to upgrade the plug-ins of Gradle and Gradle, and finally succeeded, here we will share the method with you.
I am using Intellij IDEA 13, Gradle version 1.8, and Gradle plug-in version 0.6. +. You need to upgrade Gradle to 2.1, and plug-in vers
); setContentView(R.layout.activity_displaymessage); getSupportActionBar().setDisplayHomeAsUpEnabled(true); // If your minSdkVersion is 11 or higher, instead use: // getActionBar().setDisplayHomeAsUpEnabled(true);}
Because the android: parentActivityName attribute is set, the system knows the parent Activity to be returned, so you do not need to set event listening.
Styling the Action Bar (set the ActionBar style ):
Use an Androi
) then change the suffix of the zip file. jar and put it in libs to generate the apk.
By default, all. Jar files are automatically packaged:
dependencies { compile fileTree(dir: 'libs', include: '*.jar')}
(2.3) This is now
Method I am using (recommended)In fact, it takes more than half a day. SO files are packaged into the lib folder of the APK. if you carefully read the usage of Gradle, you will naturally know that the official version of Gradle has automatically implemented packaging. SO
number of methods of an Android application cannot exceed this value. This includes the Android framework, class library, and self-developed code.
This problem can be solved by splitting a DEX file into multiple DEX files. Facebook introduced the Dalvik patch for Android apps. The Android Developers blog introduced how to solve this problem through the custom class loading process. However, these methods are complex and not elegant.
With the release of the new MultiDex support library, Google o
:
When android: installLocation is declared, but android: minSdkVersion is less than 8, we use AVD not lower than Froyo for compilation. In this way, android: installLocation will be ignored in systems lower than Froyo, the android: installLocation specified by us will be used in systems not lower than Froyo.
Suggestion:When the program performs the following actions, we should not install the program on the external storage media.
① Service
The
complete build. gradle below.
1 // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3 buildscript { 4 repositories { 5 jcenter() 6 } 7 dependencies { 8 classpath 'com.android.tools.build:gradle:2.1.0' 9 classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'10 // NOTE: Do not place your application dependencies here; they belong11 // in the individual module build.gradle files12 }13 }
following information in the configuration file of the main project:
xmlns:tools="http://schemas.android.com/tools"
2. Because the 360 security module is dependent on the 23 api, I relied on the 22 api to avoid unknown conflicts.
compileSdkVersion 22 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 22 targetSdkVersion 23 versionCode 1 versionName "1.0" }
3. Because there are many errors in the code,
perferExternal.
2. Do not modify minSDKVersion and ensure that your application code is compatible.
3. To compile your application, change your build target to API8 because the low android library does not know the instaillLocation attribute and does not compile your application.
Applications that do not need to be installed in External Storage
If you use usb storage to share files with your computer or uninstall the SD Card through system setting
one is to be selected in this window by default. Of course, I will select the last one.
4. Words required for creating a project
1. applicationId: application package name.2. minSdkVersion: The minimum Android version is supported.3. targetSdkVersion: Target version. It should be the Android version of the testing machine in the testing environment.4. versionCode: version number.5. versionName: version name.
5. Search for the seat of the reference
How to deal with android methods that exceed 65536. the number of method references in a. dex file exceed 64 k, android. dexI. Problem description:
The number of Dex file methods in the application exceeds the upper limit of 65536. In short, the application burst.
Ii. solution:
Solution 1: Use a plug-in framework such as: https://github.com/singwhatiwanna/dynamic-load-apk
Solution 2: Split Dex
Iii. How to split Dex files
1. Related Links
Https://developer.android.com/tools/building/multidex.htm
Androidmanifest. xml in Android Projects
The AndroidManifest. xml file in a project is as follows:
Package = "tw. suggest" // specify the package path of the program file in the project.
Android: versionCode = "1" // version number of this project
Android: versionName = "1.0"> // version name of the project
Android: minSdkVersion = "1" // The lowest API version available for this project
Android: targetSdkVersion = "10"
will make a dull sound.
The process is as follows:
6. In the manifest file, you need to set the following parts:
Set permissions:
Android version restrictions:
Android: minSdkVersion = "14"
Restrict the devices to be installed:
Set the Intent Filter of the Activity, for example, one of the three filtering mechanisms:
Next, let's take the first example. This example belongsCard reader modeRead and Write Data from the NFC chip.
The content of
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.