Signed APK file not working while debug APK works
Asked Answered
C

2

7

So I just finally finished my first app and wanted to put it in the google store and for an unknown reason it always says "You must import a valid .apk file.".

I really don't know what I'm doing, I looked everywhere and kinda understood that i had to build a signed APK, which I did multiple times and none of them works.

Plus, important detail I just noticed: The signed apk doesn't work while the debug apk works with my phone?

And when I build a signed apk it says this as an error in the Gradle Console :

"Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\Lois\AndroidStudioProjects\iobner\app\src\main\java\com\lf\gt\knowy\suggestions.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details."

Can anyone help me? What do I have to do to make a working signed APK? And why does it not work while the debug works?! I have no experiences in this and learnt by myself to do the whole app but can't seem to find the problem by myself this time... Thank you!

Cementum answered 17/11, 2017 at 3:59 Comment(2)
Could you add the whole stack trace ?Mme
@Louis Bouchard The given error is just the warning it will never face the problem with apk. Actual problem is with your signed APK. You can refer this and this for signed apk issue. I hope this will help you out.Palmy
M
4

If you want to debug your release apk , add debuggable option in your manifest or gradle.

If you want to modify your AndroidManifest.xml

 <application
            android:debuggable="true"
            android:name=".YourApplication"
            android:allowBackup="true"
            android:icon="@mipmap/your_icon"
            android:label="@string/app_name"
            android:theme="@style/AppTheme"/>

Update

Signing APK Guide:

https://developer.android.com/studio/publish/app-signing.html

Mahatma answered 17/11, 2017 at 4:40 Comment(1)
Well I juste want to make an APK that I can release on the android store... I don't really know if I have to make it debuggable or not or anything.Cementum
M
0

I had similar problem. Only now I discovered that the standard intellIj and Android Studio mode are debug mode.

I set the debugable flag for the Release mode, but when I signed the release AAB or APK, they kept not working, because the flag was set false.

  <application
        android:debuggable="true"

I had to debug my Release code manually to discover that my problems were with some threads, as I explain here:

https://mcmap.net/q/1625903/-signed-apk-is-not-working-as-debug-apk-java-androidstudio

Masculine answered 19/7, 2022 at 14:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.