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.

Correctly decompiled & recompiled APK crashes on start-up

See original GitHub issue

Information

  1. Apktool Version (apktool -version) - v2.4.1

  2. Operating System (Mac, Linux, Windows) - MacOS

  3. APK From? (Playstore, ROM, Other) - Playstore/Manufacturer

Stacktrace/Logcat

2020-07-25 17:43:03.503 26542-26542/? E/LoadedApk: Unable to instantiate appComponentFactory
    java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.AppComponentFactory" on path: DexPathList[[zip file "/data/app/dji.go.v5-2ay_BUceLK5SA17Q8TVPcw==/base.apk"],nativeLibraryDirectories=[/data/app/dji.go.v5-2ay_BUceLK5SA17Q8TVPcw==/lib/arm64, /data/app/dji.go.v5-2ay_BUceLK5SA17Q8TVPcw==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.LoadedApk.createAppFactory(LoadedApk.java:256)
        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:855)
        at android.app.LoadedApk.getClassLoader(LoadedApk.java:950)
        at android.app.LoadedApk.getResources(LoadedApk.java:1188)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2499)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2491)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6508)
        at android.app.ActivityThread.access$1600(ActivityThread.java:231)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1974)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7707)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Steps to Reproduce

Download the APK here: https://www.dji.com/nl/downloads/djiapp/dji-fly (click on Download for Android)

  1. Run apktool d APKHERE
  2. Run apktool b APKDIRECTORY
  3. Sign the APK
  4. Install the APK, make sure you’ve got an arm64-v8a chipset.
  5. Start the app, it’ll first paint & crash.

Just run apktool, without changing anything, decode + recompile & it fails.

Frameworks

None

APK

DJI Fly: https://www.dji.com/nl/downloads/djiapp/dji-fly

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? Resigned the APK. I’ve tried to use --no-src, etc etc.

  3. Are you using the latest apktool version? Yes, v2.4.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hunterxxxcommented, Dec 5, 2020

I have similar situation where I resigned the apk before using apktool, installed it without problem. But when I apktool d, apktool b, it crashes.

0reactions
shipsyworcommented, Mar 6, 2021

@giacomoferretti Can you atleast link to the relevant guides to modify the app so we can search further?

Read more comments on GitHub >

github_iconTop Results From Across the Web

apk crashed on launch when re-signed with debug key
normally I use apktool to decompile and recompile and then use testsign.jar to resign the apk with the debug keys or uber apk...
Read more >
Crash when decompiling and rebuilding with apktool
I'm trying to decompile the instagram apk with apktool. Right now for leaning I'm literally just decompiling, recompiling and resigning ...
Read more >
Android App suddenly crashes when compiling in Release ...
Your very first message indicates that you were doing a release build. The reason it crashed was because you didn't have a proguard.cfg...
Read more >
How to Make Your Malicious Android App Be More Convincing.
First check if you can run apktool properly by running the command: apktool ... apktool will now decompile app.apk to /pathtoyourfolder/folder.
Read more >
Crashes | Android Developers
An Android app crashes whenever there's an unexpected exit caused by an ... and confirming that the parameters you passed were correct, ...
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