Apktool et "No resource identifier found for ..."

Lors de la recompilation de sources, apktool passe en erreur car il ne reconnait pas certaines ressources, dans mon cas :
- foregroundServiceType
isSplitRequired
$ java.exe -Xmx12560m -jar apktool_2.4.1.jar b application.apk-decompiled I: Using Apktool 2.4.1 I: Checking whether sources has changed... I: Smaling smali folder into classes.dex... I: Checking whether sources has changed... I: Smaling smali_classes2 folder into classes2.dex... I: Checking whether sources has changed... I: Smaling smali_classes3 folder into classes3.dex... I: Checking whether sources has changed... I: Smaling smali_classes4 folder into classes4.dex... I: Checking whether resources has changed... I: Building resources... W: AndroidManifest.xml:43: error: No resource identifier found for attribute 'isSplitRequired' in package 'android' W: W: AndroidManifest.xml:43: error: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android' W: W: AndroidManifest.xml:67: error: No resource identifier found for attribute 'foregroundServiceType' in package 'android' W: W: AndroidManifest.xml:316: error: No resource identifier found for attribute 'foregroundServiceType' in package 'android' W: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Eric\AppData\Local\Temp\brut_util_Jar_4855427262860801045.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 29, --version-code, 1508521000, --version-name, 15.08.52, --no-version-vectors, -F, C:\Users\Eric\AppData\Local\Temp\APKTOOL6835006980751036226.tmp, -e, C:\Users\Eric\AppData\Local\Temp\APKTOOL6387725646389430499.tmp, -0, arsc, -I, C:\Users\Eric\AppData\Local\apktool\framework\1.apk, -S, res, -M, AndroidManifest.xml] Process exited with code 1.
Ce problème classique peut provenir de l’appel à une nouvelle version des librairies d’Android pas encore nativement pris en charge par apktool. La solution est de rajouter “à la main” la nouvelle librairie. Dans l’exemple ci-dessus on va rajouter une version récente de framework-res.apk. Idéalement on récupère le fichier directement sur le téléphone (solution alternative : télécharger une rom récente et extraire le fichier).
adb pull /system/framework-res.apk <path_to_your_computer>
apktool if framework-res.apk
Autre astuce (apktool error: attribute android:xxxx not found)
apktool empty-framework-dir --force
Une dernière pour la route
adb install -r podcast.apk
Performing Streamed Install
adb: failed to install podcast.apk: Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]
Ajouter dans la section application :
android:extractNativeLibs="true"