AppNinja article solution: the targetSdkVersion version is too low and the installation fails, the installation apk prompts that the version is too low, the method of modifying the targetsdkversion, with a package modification tool

 Solve the problem that the version of targetSdkVersion is too low and the installation fails, the installation apk prompts that the version is too low, how to modify the targetsdkversion

Go directly to the solution:

 1. Packaging error AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersionCodename' in package 'android'

Solution: Delete 'compileSdkVersionCodename' related in AndroidManifest.xml.

二、安装错误 adb install -r SystemActivities.apk Performing Streamed Install adb: failed to install SystemActivities.apk: Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1716187195.tmp/base.apk (at Binary XML file line #0): Requires newer sdk version #28 (current version is #27)]

Solution: After opening with apkide, find the apktool.yml file and downgrade the sdk version number in it

Detailed description:

In order for the application to specify the version that can be run, the <uses-sdk> tag is provided in the manifest file of Android. There are three attributes in this tag, namely minSdkVersion, targetSdkVersion, maxSdkVersion.

Android:minSdkVersion —— This attribute determines the minimum system version that your application can be compatible with, and this attribute must be set in one case.

android:targetSdkVersion —— This attribute indicates that your current application is developed and designed for a certain system version, that is to say, there is no problem running on this system version. For mobile phones or other terminal devices, it will decide whether to display some features and effects according to the value of this attribute. Of course, the most direct impact on developers is that the APIs you use are based on this version, and APIs higher than this targetSdkVersion will have warning or error prompts when using them.

android:maxSdkVersion —— This attribute determines the maximum version that your application can support. Systems that exceed this version will not be able to use your application.

When packaging APK, we often encounter problems similar to targetSdkVersion version.

1. APKIDE APK package compilation error

正在编译Apk... 
  - 失败:
W: AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersion' in package 'android'
W: AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersionCodename' in package 'android'

Solution: Delete 'compileSdkVersionCodename' related in AndroidManifest.xml.

2. Installation error

adb install -r SystemActivities.apk
Performing Streamed Install
adb: failed to install SystemActivities.apk: Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1716187195.tmp/base.apk (at Binary XML file line #0): Requires newer sdk version #28 (current version is #27)]

Solution:
After opening with apkide, find the apktool.yml file and downgrade the sdk version number in it:

sdkInfo:
  minSdkVersion: '27'
  targetSdkVersion: '27'


If compilation fails, delete the sdkversion version number in AndroidManifest.xml.

Tool download address:

ApkIDE3.3.0.0 author's original version, solve common apk packaging and installation problems.rar
ApkIDE3.3.0.0 author's original version, solve common apk packaging and installation problems.rar-Android Documentation Resources-CSDN Download
 

Guess you like

Origin blog.csdn.net/a2831942318/article/details/121564997