question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compileSdkVersion value changed in AndroidManifest.xml file

See original GitHub issue

Information issue #1852 #1909

After decompiling and recompiling with apktool, the contents of the AndroidManifest.xml file are changed as follows. 0. 2.3.3 version works as normal.

  1. Apktool Version (apktool -version) - 2.3.4 & 2.4.0
  2. Operating System (Mac, Linux, Windows) -Windows10
  3. APK From? (Playstore, ROM, Other) - Other

Steps to Reproduce

  1. original : AndroidManifest.xml -> android:compileSdkVersion=“28”
  2. delete framework(1.apk)
  3. ‘d’ option ->
  4. ‘b’ option ->
  5. Check the AndroidManifest.xml file. AndroidManifest.xml -> android:compileSdkVersion=“23” compileSdkVersion changed

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it. sample_compilesdkversion.zip

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes.
  2. If you are trying to install a modified apk, did you resign it? N/A
  3. Are you using the latest apktool version? Yes. 2.3.4 & 2.4.0 version

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
PiR43commented, Jul 31, 2019

Same problem here, compileSdk changed from “9” to “6.0-2438415” with apkTool 2.3.4 or 2.4.0. But no problem with apkTool 2.3.3 (compileSdk not modified) so regression seems be in 2.3.4 version.

1reaction
iBotPeachescommented, Nov 29, 2020

Old

➜  debug git:(master) ✗ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1d
    A: android:compileSdkVersionCodename(0x01010573)="10" (Raw: "10")
➜  debug git:(master) ✗ 

Rebuilt

➜  dist git:(master) ✗ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x17
    A: android:compileSdkVersionCodename(0x01010573)="6.0-2438415" (Raw: "6.0-2438415")
➜  dist git:(master) ✗ 

Indeed changed (aapt1).

Let me try aapt2.

➜  app-debug git:(master) ✗ apktool b . --use-aapt2
I: Using Apktool 2.4.2-f545c2-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
➜  app-debug git:(master) ✗ cd dist 
➜  dist git:(master) ✗ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x17
    A: android:compileSdkVersionCodename(0x01010573)="6.0-2438415" (Raw: "6.0-2438415")
➜  dist git:(master) ✗ 

Nope, still busted. Marking as bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Android Studio throw errors in the manifest file ...
I changed the compileSdkVersion & targetSdkVersions in app gradle file from 26 to 23. I clicked sync now. It resulted in 7 error...
Read more >
CompileSdkVersion and targetSdkVersion — what is the ...
In this article, we'll take a closer look at two values that are set in the build.gradle file: compileSdkVersion and targetSdkVersion.
Read more >
<manifest> | Android Developers
The value of the package attribute in the APK's manifest file represents your app's universally unique application ID. It has to be formatted...
Read more >
Picking your compileSdkVersion, minSdkVersion ... - Medium
It should be emphasized that changing your compileSdkVersion does not change runtime behavior. While new compiler warnings/errors may be ...
Read more >
Get Started | Android - Google Developers
Use Android Studio 3.2 or higher · Make sure that your app's build file uses the following values: A minSdkVersion of 19 or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found