3

My android application is able to install in Oreo & Pie without any problem. If I tried to install the release build in Marshmallow & Nougat version of phone it is throwing an error "There is error while parsing the package" Please find my sdk version in gradle

compileSdkVersion 28
  minSdkVersion 21
  targetSdkVersion 28
  implementation com.android.support:appcompat-v7:28.0.0
  implementation com.android.support:support-v4:28.0.0
  implementation com.android.support:design:28.0.0

Suppose If I change my compile & target sdk version to 26 does it work in Marshmallow & Nougat devices? If I change to SDK version to 26 and support libraries to 26.0.0 am getting build error like android resource linking failed.

Please help me to resolve this issue and provide solution for my android application should support from marshmallow to pie[latest forward compatibility].

Thanks in Advance

ADM
  • 20,406
  • 11
  • 52
  • 83

4 Answers4

2

As per your build gradle, I think your buildToolsVersion is not proper.

buildToolsVersion '28.0.3'

Change your buildToolsVersion as per above.

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
Rajan Kashiyani
  • 891
  • 7
  • 11
1

There is no change in your build.gradle file. Please proceed with same configuration "compileSdkVersion 28 minSdkVersion 21 targetSdkVersion 28 " . It looks fine

I guess there is a problem in release apk. Please recheck following common mistake:

  • Are you installing release apk directly from SD card.( You should not install release apk directly, you need to publish in play console, then only you can use your apk otherwise you should use debug apk only )
  • Version number ( Whether it is already not used )
  • Are you renamed your release apk file ? - If you did means please rename back to old name.
  • Correct the API level in manifest file. ( Cross check with build.gradle file )
Magudesh
  • 419
  • 5
  • 13
0

Hi Everybody Thanks for the suggestion and comments. Finally I found what is the issue in Nougat 7.0 version.

The issue not with the gradle. Issue due to my package name in project folder i.e Activities,Services,Utilities,Models all the package name has been starts with Capital letter so it throws an error saying that in android manifest file android:name is not defined[not able to recognize while trying to install in Nougat device].

Found issue by installing the release apk in API Level 24 & 25 simulator and found out the error in LogCat.

Once I modified all the package name in my project with small letter i.e activities,services,utilities, now I can able to install the release apk in Nougat version device.

Now unable to install it in Marshmallow device 6.0. This time am getting App is not installed error

Please let me know what am missing for version 6.0 devices.

Thanks in Advance

  • Fixed. Selecting Signature Version v1 and v2 while generating signed release apk solved the problem for me.. Now my app is working fine from Marshmallow to Pie. Thanks – DineshKumar Rajasekar Mar 08 '19 at 08:49
-1

compileSdkVersion and targetSdkVersion are usually kept similar and by defining this, you tell the app what android devices are you specifically making the app for. So whatever your targetSdkVersion is, the app will run smoothest in this.

minSdkVersion is the minimum sdk that you want to target. So if you want the minimum device supported to be a Marshmallow then the app would not be available for a device having api version below Marshmallow, in fact the app won't even appear on playstore.

Sagar Balyan
  • 620
  • 6
  • 20
  • Op's question is not about definition its about ERROR `There is error while parsing the package` . So your answer does not make any sense. – ADM Mar 08 '19 at 04:36