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!

Louis Bouchard
  • 199
  • 3
  • 9
  • Could you add the whole stack trace ? – Rajan Kali Nov 17 '17 at 04:05
  • 1
    @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](https://stackoverflow.com/questions/44386464/android-app-installation-failed-package-com-my-app-has-no-certificates-at-entry/44387533#44387533) and [this](https://stackoverflow.com/questions/44671778/published-app-on-play-store-cant-communicate-with-google-maps-api-and-facebook/44672565#44672565) for signed apk issue. I hope this will help you out. – Andy Developer Nov 17 '17 at 05:47

2 Answers2

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

diegoveloper
  • 93,875
  • 20
  • 236
  • 194
  • 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. – Louis Bouchard Nov 17 '17 at 04:47
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://stackoverflow.com/a/72970683/19544120