Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] App crashes due to android.content.res.Resources$NotFoundException #3525

Closed
ghost opened this issue Feb 19, 2024 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Feb 19, 2024

Information

  1. Apktool Version (apktool -version) 2.9.3
  2. Operating System (Mac, Linux, Windows) Windows
  3. APK From? (Playstore, ROM, Other) Other
  4. Java Version (java --version) 21.0.2

CMD output

PS D:\Modding Apps\Apktool> java -jar apktool.jar  d "F:\Mod\VPhoneGaGa Gold v3.6 64-Bit (Android 7-10).apk" 
I: Using Apktool 2.9.3 on VPhoneGaGa Gold v3.6 64-Bit (Android 7-10).apk
I: Loading resource table...
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\xxx\AppData\Local\apktool\framework\1.apk
S: Could not decode file, replacing by FALSE value: drawable/cloud.png
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
PS D:\Modding Apps\Apktool> java -jar apktool.jar b "D:\Modding Apps\Apktool\VPhoneGaGa Gold v3.6 64-Bit (Android 7-10)"
I: Using Apktool 2.9.3
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...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk into: D:\Modding Apps\Apktool\VPhoneGaGa Gold v3.6 64-Bit (Android 7-10)\dist\VPhoneGaGa Gold v3.6 64-Bit (Android 7-10).apk

Logcat

2-19 15:51:05.360 W/ResourceType(19424): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 748
02-19 15:51:05.361 D/AndroidRuntime(19424): Shutting down VM
02-19 15:51:05.361 E/AndroidRuntime(19424): FATAL EXCEPTION: main
02-19 15:51:05.361 E/AndroidRuntime(19424): Process: com.vphonegaga.titan, PID: 19424
02-19 15:51:05.361 E/AndroidRuntime(19424): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vphonegaga.titan/com.vphonegaga.titan.StartActivity}: android.content.res.Resources$NotFoundException: File res/layout/APKTOOL_DUPLICATE_layout_0x7f0d0015 from xml type layout resource ID #0x7f0d0015
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3491)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3659)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2115)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.os.Handler.dispatchMessage(Handler.java:106)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.os.Looper.loop(Looper.java:250)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.ActivityThread.main(ActivityThread.java:7755)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at java.lang.reflect.Method.invoke(Native Method)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
02-19 15:51:05.361 E/AndroidRuntime(19424): Caused by: android.content.res.Resources$NotFoundException: File res/layout/APKTOOL_DUPLICATE_layout_0x7f0d0015 from xml type layout resource ID #0x7f0d0015
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1277)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.Resources.loadXmlResourceParser(Resources.java:2426)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.Resources.loadXmlResourceParser(Resources.java:2402)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.Resources.getLayout(Resources.java:1252)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:530)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(Unknown Source:231)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(Unknown Source:6)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(Unknown Source:4)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at androidx.appcompat.app.AppCompatActivity.setContentView(Unknown Source:4)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at com.vphonegaga.titan.StartActivity.onCreate(Unknown Source:81)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.Activity.performCreate(Activity.java:8077)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.Activity.performCreate(Activity.java:8061)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3464)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	... 11 more
02-19 15:51:05.361 E/AndroidRuntime(19424): Caused by: java.io.FileNotFoundException: Corrupt XML binary file
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.AssetManager.nativeOpenXmlAsset(Native Method)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:1092)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1261)
02-19 15:51:05.361 E/AndroidRuntime(19424): 	... 25 more
02-19 15:51:05.363 W/ActivityTaskManager( 1798):   Force finishing activity com.vphonegaga.titan/.StartActivity

Steps to Reproduce

  1. apktool d (apk)
    2 apktool b (apk)
    3 sign

Frameworks

None

APK

https://mega.nz/file/7IhjCZZT#LXRuyWHyxByiFwwJ4letzXqnd9opTI1LxnXQ5U23OeU

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
Copy link
Owner

It looks like this is a long-standing issue that affects applications in different ways. You can see in these issues below the root cause may be this same type of error:

I'll take a peek and merge this into one of those issues if it aligns.

@ghost
Copy link
Author

ghost commented Feb 19, 2024

Alright. Forgot to mention, the APK won't install on Android 12 and above, not sure if it's related

@iBotPeaches
Copy link
Owner

I'm going to close as duplicate of: #2849

This one is because of the obfuscation of resources leading to DUPLICATE_NAME_xx resources and the other is the same deal but random resource names that often has collisions.

@iBotPeaches iBotPeaches closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant