-2

I am getting a weird issue with my Android Studio.

If I run my application in Android device with OS version 5.0 or up it works but , if the same build is used in other device than it crashes.

Another case is that if I run app in device with OS version 4.4 or lower and if I use that build in other devices than it runs perfect in all OS version of device.

I have tried with changing the build version , but still not sure why the issue crops up.

Any solutions please help .

OneCricketeer
  • 126,858
  • 14
  • 92
  • 185
Hardik Chauhan
  • 2,652
  • 13
  • 28
  • 1
    post error log and your gradle build file code – Zaki Pathan Mar 15 '17 at 11:36
  • Post your manifest. I expect your project has a mininmum verision assigned. Check out this topic http://stackoverflow.com/questions/19465049/changing-api-level-android-studio I highly expect it's what you need – Phil3992 Mar 15 '17 at 11:36
  • What do you mean with "use that debug-build in other device"? – Henry Mar 15 '17 at 11:41
  • Instant run (which is applied api level 21 and above) creates, "connected device specific" builds/apks. This must be your case if you are trying to use the apk which is created under /build/outputs/apk/ after run/debug selection from Android Studio. – Devrim Mar 15 '17 at 11:46
  • please check in which drawable folder you have put the images ? Is this drawable-v21 ? – Sangram Haladkar Mar 15 '17 at 12:05

1 Answers1

1

A fast way to identify the problem should be:

  • Check the crash logs. You will always find useful information there.
  • Check the minimum build versions at the gradle files.
  • Clean the project before build it. Yes, looks silly but many times you will face problems related to the not synchronized builds (some code updated but other don't specially if you were debuging).
  • Check dependencies. Some dependencies will rely on other software installed on the device, like Play Services.
  • Check version compatibility. Yes, with new Android versions, something changes. Lollipop (Android 5.x) is an inflection point for many changes, specially related to security and visualization features.

I hope this tips help you find the solution.

pRaNaY
  • 21,330
  • 22
  • 85
  • 134
Walter Palladino
  • 479
  • 1
  • 3
  • 8