1

I made an app and tested everything. I was working fine in emulators and in USB-connected devices but did not work when generating signed apk file. I have made the app with both disabled/enabled instant run and it still didn't work.

I also tried uninstalling (for all users) and reinstalling the apk, still the issue remained (but application works fine with build apk). I have possibly tried all solutions available in similar posts but I can't find a solution, any help would be much appreciated.

Matthew
  • 1,905
  • 3
  • 19
  • 26
karthik
  • 528
  • 4
  • 19
  • Can you be more detailed of what you use to determine what is the problem. – Crammeur Aug 05 '18 at 09:40
  • The exact problem i am facing now is , after installing the app, the app openend and just closed again automatically .(not showing any message like app crashed) – karthik Aug 05 '18 at 09:42
  • 1
    Before opening the application on mobile, open up Android Studio and the logs terminal. Then open the application and if it crashes, the error logs will be displayed on Android Studio's terminal. You can then easily interpret why your application is not working on that mobile – Syed Rafay Aug 05 '18 at 09:45
  • Did you use proguard while generating signed build? – Viswanath Kumar Sandu Aug 05 '18 at 10:36
  • yes i have used proguard – karthik Aug 05 '18 at 10:38
  • Looking at the [logcat output](https://developer.android.com/studio/command-line/logcat) would be a good start. – Pierre Aug 05 '18 at 20:21

1 Answers1

0

I solved my problem by adding these 2 lines in my proguard-rules.pro file:

-keep class android.support.v7.widget.SearchView { *; }

-keep class android.support.v7.widget.ShareActionProvider { *; }

I have used search view in my activity, so I needed these library files to work when generating a signed apk. However I don't know why without including these files my app worked perfectly in emulators and in devices with usb debugging and not showing any errors in logcat files - it made it difficult to understand the problem.

Matthew
  • 1,905
  • 3
  • 19
  • 26
karthik
  • 528
  • 4
  • 19