Signed APK file not working while debug APK works

Viewed 7071

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!

2 Answers

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

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://stackoverflow.com/a/72970683/19544120

Related