3
  1. New Project.
  2. Imported all libs using gradle build system.
  3. Gradle build successful.
  4. Enabled gradle offline work and instant run.
  5. Attached my device, clicked run. App build competed in 4 mins.
  6. After few changes in code I clicked apply changes.
  7. App runs perfectly on device which I previously build, but when I extract the installed app(debug keys) it doesn't install on other device or same device (package currept).
  8. I clicked build apk(debug) in Android studio but gradle build running forever.

Please help me friends. There is no error in code. When I use Instant Run app opens perfectly on device but I cannot extract that apk to test on other device.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Nithis
  • 33
  • 1
  • 4

2 Answers2

5

You need to disable Instant Run first, because debug apk built with Instant Run will not run on phone with different api level from your test device.

Then you need to clean up and build the apk. If building apk seems like forever, make sure your internet connection is up.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
  • 1
    I enabled gradle offline mode. Is that a problem? – Nithis Jan 28 '18 at 03:35
  • Gradle build successful but build apk and run(instant run disabled) is taking time (always gradle build running) I waited for almost 5 hours but it's not successfully build apk, just "gradle build running" – Nithis Jan 28 '18 at 03:37
  • 1
    Finally, it works. Clean and rebuild. Btw thanks for your help – Nithis Jan 28 '18 at 04:21
-1

To Fix this Issue no need to enable gradle online mode. I just cleaned Project and done rebuild. Then restarted Android studio. Now it's build apk very fast. It's recommend to enable gradle offline mode (not for initial build and when importing new libs)

Nithis
  • 33
  • 1
  • 4