0

App is running fine on my android studio but whenever download from play store app crash on android nougat or lower then then i included multidex but still same error

Error Image Click Here

Build Gradle :

Build Gradle :
android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.-----.app"
        minSdkVersion 15
        targetSdkVersion 29
        multiDexEnabled true               //include
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies:

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-ads:18.0.0'
    implementation 'com.android.support:multidex:2.1.0'    // Multidex
    implementation 'com.google.android.material:material:1.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'




}

MainActivity:


public class MainActivity extends AppCompatActivity  implements View.OnClickListener  {

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base)
        MultiDex.install(this)
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) { //Fucntion

             My code 

1 Answers1

0

You are doing code shrinking for release builds with ProGuard and some classes that should be there are striped out by the build tool. You need to update your proguard-rules.pro (or whatever name is defined in the app gradle), for example by inserting

-keep class com.example.MyClass

or likewise entries. I recommend you to check the proguard section of the libraries you are using. Copy those rules and add them to yours.

You can also check this for more information.

Mehmed
  • 2,880
  • 4
  • 41
  • 62