New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No resource identifier found for attribute 'showWhenLocked' #1667

Closed
kylex2 opened this Issue Nov 21, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@kylex2

kylex2 commented Nov 21, 2017

Information

  1. Apktool Version (apktool -version) - 2.3.1-f7a872-SNAPSHOT
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - https://www.apkmirror.com/apk/google-inc/camera/camera-5-1-016-174405463-release/

Stacktrace/Logcat

$ ./apktool-git d base-camera-5.1.016.apk 
I: Using Apktool 2.3.1-f7a872-SNAPSHOT on base-camera-5.1.016.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/kylex2/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

$ ./apktool-git b base-camera-5.1.016/
I: Using Apktool 2.3.1-f7a872-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /home/kylex2/base-camera-5.1.016/AndroidManifest.xml:89: error: No resource identifier found for attribute 'showWhenLocked' in package 'android'
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_1343311019218654161.tmp, p, --forced-package-id, 127, --min-sdk-version, 26, --target-sdk-version, 27, --version-code, 41343466, --version-name, 5.1.016.174405463, --no-version-vectors, -F, /tmp/APKTOOL8057650776545101906.tmp, -0, arsc, -0, META-INF/services/com.google.protobuf.GeneratedExtensionRegistryLoader, -0, apk, -0, bin, -0, arsc, -I, /home/kylex2/.local/share/apktool/framework/1.apk, -S, /home/kylex2/base-camera-5.1.016/res, -M, /home/kylex2/base-camera-5.1.016/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:485)
	at brut.androlib.Androlib.buildResources(Androlib.java:419)
	at brut.androlib.Androlib.build(Androlib.java:318)
	at brut.androlib.Androlib.build(Androlib.java:270)
	at brut.apktool.Main.cmdBuild(Main.java:224)
	at brut.apktool.Main.main(Main.java:75)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_1343311019218654161.tmp, p, --forced-package-id, 127, --min-sdk-version, 26, --target-sdk-version, 27, --version-code, 41343466, --version-name, 5.1.016.174405463, --no-version-vectors, -F, /tmp/APKTOOL8057650776545101906.tmp, -0, arsc, -0, META-INF/services/com.google.protobuf.GeneratedExtensionRegistryLoader, -0, apk, -0, bin, -0, arsc, -I, /home/kylex2/.local/share/apktool/framework/1.apk, -S, /home/kylex2/base-camera-5.1.016/res, -M, /home/kylex2/base-camera-5.1.016/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:456)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:471)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_1343311019218654161.tmp, p, --forced-package-id, 127, --min-sdk-version, 26, --target-sdk-version, 27, --version-code, 41343466, --version-name, 5.1.016.174405463, --no-version-vectors, -F, /tmp/APKTOOL8057650776545101906.tmp, -0, arsc, -0, META-INF/services/com.google.protobuf.GeneratedExtensionRegistryLoader, -0, apk, -0, bin, -0, arsc, -I, /home/kylex2/.local/share/apktool/framework/1.apk, -S, /home/kylex2/base-camera-5.1.016/res, -M, /home/kylex2/base-camera-5.1.016/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:450)
	... 6 more

Steps to Reproduce

  1. apktool empty-framework-dir
  2. apktool d <name.apk>
  3. apktool b <name.apk>

APK

If this APK can be freely shared, please upload/attach a link to it.
https://www.apkmirror.com/apk/google-inc/camera/camera-5-1-016-174405463-release/

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? Yes
  3. Are you using the latest apktool version? Yes
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Nov 22, 2017

Owner
W: /Users/connortumbleson/Desktop/Apktool/Bugs/Bug1667/camera/AndroidManifest.xml:89: error: No resource identifier found for attribute 'showWhenLocked' in package 'android'

This resource was added in API27 - https://developer.android.com/reference/android/R.attr.html#showWhenLocked

I don't have API27 yet, last commit was API26 - ff8245a

I will patch that this weekend. Sorry about this.

Owner

iBotPeaches commented Nov 22, 2017

W: /Users/connortumbleson/Desktop/Apktool/Bugs/Bug1667/camera/AndroidManifest.xml:89: error: No resource identifier found for attribute 'showWhenLocked' in package 'android'

This resource was added in API27 - https://developer.android.com/reference/android/R.attr.html#showWhenLocked

I don't have API27 yet, last commit was API26 - ff8245a

I will patch that this weekend. Sorry about this.

@iBotPeaches iBotPeaches added the Bug label Nov 22, 2017

@iBotPeaches iBotPeaches self-assigned this Nov 22, 2017

@iBotPeaches iBotPeaches added this to the 2.3.1 milestone Nov 22, 2017

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Nov 23, 2017

Owner
➜  Bug1667 apktool d camera.apk -f
I: Using Apktool 2.3.1-18143c-SNAPSHOT on camera.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /Users/connortumbleson/Library/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  Bug1667 apktool b camera
I: Using Apktool 2.3.1-18143c-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1667 
Owner

iBotPeaches commented Nov 23, 2017

➜  Bug1667 apktool d camera.apk -f
I: Using Apktool 2.3.1-18143c-SNAPSHOT on camera.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /Users/connortumbleson/Library/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  Bug1667 apktool b camera
I: Using Apktool 2.3.1-18143c-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1667 

iBotPeaches added a commit that referenced this issue Nov 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment