Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] Cannot build APK - cannot assign ID [x] to [resource] because package already has id [x]

Open philiprace opened this issue 9 months ago • 1 comments
trafficstars

Information

  1. Apktool Version (apktool -version) - APK Editor Studio v1.7.2
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - other (apkmirror)
  4. Java Version (java --version) - build 1.8.0_441-b07

Stacktrace/Logcat

I: Using Apktool 2.11.0 on com.ebay.mobile_6.116.0.1-6116001_minAPI26(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk with 4 threads
I: Copying raw classes.dex file...
I: Copying raw classes10.dex file...
I: Copying raw classes11.dex file...
I: Copying raw classes12.dex file...
I: Copying raw classes13.dex file...
I: Copying raw classes2.dex file...
I: Copying raw classes3.dex file...
I: Copying raw classes4.dex file...
I: Copying raw classes5.dex file...
I: Copying raw classes6.dex file...
I: Copying raw classes7.dex file...
I: Copying raw classes8.dex file...
I: Copying raw classes9.dex file...
I: Building resources with aapt2...
W: error: can't assign ID 0x81010000 to resource com.ebay.mobile.uiThreeDimensionalModelViewerDynamic:drawable/sceneform_hand_phone because package already has ID 81.
W: error: failed assigning IDs.
Exception in thread "main" brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Philip\AppData\Local\Temp\brut_util_Jar_65160648751296062942020340567947012560.tmp, link, -o, C:\Users\Philip\AppData\Local\Temp\APKTOOL2875898626570267625.tmp, --allow-reserved-package-id, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 33, --rename-manifest-package, com.ebay.mobile, --rename-instrumentation-target-package, com.ebay.mobile, --version-code, 6194102, --version-name, 6.194.1.2, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --no-compile-sdk-metadata, --warn-manifest-validation, -I, C:\Users\Philip\AppData\Local\apk-editor-studio\frameworks\1.apk, -I, C:\Users\Philip\AppData\Local\apk-editor-studio\frameworks\127.apk, --manifest, C:\Users\Philip\AppData\Local\Temp\apk-editor-studio\apk\{5dd32d57-96f5-4200-ab6e-5bdce37a688c}\AndroidManifest.xml, C:\Users\Philip\AppData\Local\Temp\apk-editor-studio\apk\{5dd32d57-96f5-4200-ab6e-5bdce37a688c}\build\resources.zip]
	at brut.androlib.AaptInvoker.invoke(SourceFile:0)
	at brut.androlib.ApkBuilder.buildResources(SourceFile:0)
	at brut.androlib.ApkBuilder.build(SourceFile:0)
	at brut.apktool.Main.main(SourceFile:0)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Philip\AppData\Local\Temp\brut_util_Jar_65160648751296062942020340567947012560.tmp, link, -o, C:\Users\Philip\AppData\Local\Temp\APKTOOL2875898626570267625.tmp, --allow-reserved-package-id, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 33, --rename-manifest-package, com.ebay.mobile, --rename-instrumentation-target-package, com.ebay.mobile, --version-code, 6194102, --version-name, 6.194.1.2, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --no-compile-sdk-metadata, --warn-manifest-validation, -I, C:\Users\Philip\AppData\Local\apk-editor-studio\frameworks\1.apk, -I, C:\Users\Philip\AppData\Local\apk-editor-studio\frameworks\127.apk, --manifest, C:\Users\Philip\AppData\Local\Temp\apk-editor-studio\apk\{5dd32d57-96f5-4200-ab6e-5bdce37a688c}\AndroidManifest.xml, C:\Users\Philip\AppData\Local\Temp\apk-editor-studio\apk\{5dd32d57-96f5-4200-ab6e-5bdce37a688c}\build\resources.zip]
	at brut.util.OS.exec(SourceFile)
	... 4 more

Steps to Reproduce

  1. select tools > framework manager
  2. click install and choose the apk listed
  3. close framework manager
  4. select 'open apk'
  5. select the linked apk file
  6. then attempt to save apk### 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

(https://www.apkmirror.com/apk/ebay-mobile/ebay/ebay-6-116-0-1-release/ebay-fashion-car-parts-tech-6-116-0-1-android-apk-download/download/?key=957a7ee313c98e2fdde9a51b0ad5a5ce733271f4&forcebaseapk=true)

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? no, unsure how to do this.
  2. If you are trying to install a modified apk, did you resign it? no, cannot build.
  3. Are you using the latest apktool version? yes

just a side note, this is very possibly not a bug - i am well out of my comfort zone and am probably doing something entirely wrong here. if someone could give me some guidance on how to navigate the issue i'm facing that would be greatly appreciated.

Thanks.

philiprace avatar Feb 07 '25 21:02 philiprace

i found same issue .

vishalwasnik avatar Mar 23 '25 04:03 vishalwasnik

This APK can be decoded properly with Apktool 3.0.0 on the dev branch. The app has 2 packages in it, and an incorrect one was selected for decoding,

IgorEisberg avatar Jun 10 '25 16:06 IgorEisberg