0

I use my old phone (Redmi 6 running Android 9, MIUI 11, armv7 architecture) for teaching myself mobile programming and my new phone (Redmi 10C running Android 13, MIUI 14, aarch64 architecture) as my daily. I don't like putting my daily use phone into developer mode, and in fact Xiaomi makes it very painful to do so.

I heard that you can copy APKs from device to device so tried sharing an app I'm coding myself from my dev phone to my main phone, using Bluetooth.

When I try to install the APK I get the error App not installed as package appears to be invalid:

The actual error message

Now I know APK files are ZIP archives so I checked it is a ZIP archive and it doesn't look like the file was truncated or corrupted in any way.

I went further and copied it back to my dev phone and it did install there without complaint so that to means it's not "invalid" in the usual sense.

Is this just a misleading error? Is this the standard error message that covers every APK installation problem and not just whether the APK is valid? Does it mean my two phones have different CPU architectures? Does it mean the APK is not signed? Is it some other kind of security issue? Is there a way to get more detailed information about why it failed to install?

I tried installing f-droid from an APK and that went smoothly, so it's not all APKs.

I looked into my APKs and none of them have a lib directory and hence no architecture-specific native code. So that rules out armv7 vs aarch64 being the problem.

My APKs have no CERT.SF files in them, which I think means that are not signed. This is my best guess.

14
  • adb install or logcat should tell more information about why it failed.
    – Andrew T.
    Aug 1 at 7:23
  • 1
    I just tried logcat using a terminal emulator Termux on Android 12, and it seems it only outputs logs related to the Termux process, so... yeah, I'm afraid you need to do this from a PC, or I did something wrong. Maybe wait for other inputs...
    – Andrew T.
    Aug 1 at 7:40
  • 1
    I'm still wondering if this is caused by Android 14 blocking old apps, but I don't know how you built the app (though I'm not sure either why you wanted to target the app before Android 6.0) or whether the error reflects this behavior.
    – Andrew T.
    Aug 3 at 14:35
  • 1
    "which I think means that are not signed" now that you mentioned it... did you run the app from Android Studio directly instead of building and signing the APK? I just remembered that Android blocks installation of unsigned APKs.
    – Andrew T.
    Aug 7 at 14:21
  • 1
    Based on my experience, it's quite straightforward following the documentation: create a new keystore from Android Studio (since this is just for personal use, no need to put real info), then use it for building and signing the APK (not App Bundle); I believe you can choose the simplest signature version because it's only to satisfy the installation.
    – Andrew T.
    Aug 7 at 15:03

0

You must log in to answer this question.

Browse other questions tagged .