0

I have made an APK but whenever I build that APK i only get armeabi (32-bit) code which is not complaint with the Google play policies of Aug 1( 64 Bit Support ) and I get an error on Play Store Saying "This release is not compliant with Google Play 64-bit requirement"

This is the build.gradle file. I am not able to understand what the problem is.

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.firebase.crashlytics'
    apply plugin: 'com.google.gms.google-services'
    import com.android.build.OutputFile
        
    android {
        compileSdkVersion 29    
    
        defaultConfig {
            applicationId "com.Sample.Example"
            minSdkVersion 16
            targetSdkVersion 29
            versionCode 11
            versionName "11.0"
            multiDexEnabled true
            vectorDrawables.useSupportLibrary = true
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    
        }
    
        splits {
            abi {
                // Enables building multiple APKs per ABI.
                enable true
    
                // By default all ABIs are included, so use reset() and include to specify that we only
                // want APKs for x86, armeabi-v7a, and mips.
                reset()
    
                // Specifies a list of ABIs that Gradle should create APKs for.
                include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
    
                // Specifies that we want to also generate a universal APK that includes all ABIs.
                universalApk false
            }
        }
        
        android {
          lintOptions {
              abortOnError false
          }
        }
    
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
    }
    
    
    ext.abiCodes = ['armeabi-v7a':1, 'x86':2, 'x86_64':3, 'arm64-v8a': 4]
    
    android.applicationVariants.all { variant ->
    
        // Assigns a different version code for each output APK
        // other than the universal APK.
        variant.outputs.each { output ->
    
            // Stores the value of ext.abiCodes that is associated with the ABI for this variant.
            def baseAbiVersionCode =
                    // Determines the ABI for this variant and returns the mapped value.
                    project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
    
            
            if (baseAbiVersionCode != null) {
    
                
                output.versionCodeOverride =
                        baseAbiVersionCode * 1000 + variant.versionCode
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    
        implementation 'androidx.cardview:cardview:1.0.0'
        implementation 'com.daimajia.androidanimations:library:2.3@aar'
        implementation 'com.jakewharton:butterknife:10.2.1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
        implementation 'com.airbnb.android:lottie:3.4.1'
        implementation 'com.makeramen:roundedimageview:2.3.0'
        implementation group: 'commons-io', name: 'commons-io', version: '2.7'
        implementation 'com.google.firebase:firebase-analytics:17.4.3'
        implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
        implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
        implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
        implementation 'androidx.recyclerview:recyclerview:1.1.0'
        implementation group: 'com.google.android.material', name: 'material', version: '1.3.0-alpha01'
        implementation 'com.jpardogo.googleprogressbar:library:1.2.0'
        implementation 'com.github.fodroid:XStatusBarHelper:v1.1'
        implementation 'org.litepal.android:core:1.3.0'
        implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
        implementation 'com.github.bumptech.glide:glide:4.11.0'
        implementation group: 'com.google.android.gms', name: 'play-services-ads', version: '19.1.0'
        implementation group: 'com.romainpiel.shimmer', name: 'library', version: '1.4.0'
        implementation 'androidx.multidex:multidex:2.0.1'
        implementation 'com.intuit.sdp:sdp-android:1.0.5'
        implementation 'com.facebook.android:audience-network-sdk:5.9.1'
        implementation 'com.facebook.shimmer:shimmer:0.5.0'    
    }

Module Level build.gradle
    
    buildscript {
        
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
            
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.6.1'
            classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
            classpath 'com.google.gms:google-services:4.3.3' 
    
            
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
            
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
sonique
  • 4,539
  • 2
  • 30
  • 39
Archit K
  • 11
  • 1
  • Any C/C++ code/library in the project itself, like in a `jni` directory? – Morrison Chang Jun 25 '20 at 21:32
  • No, its purely in Java – Archit K Jun 25 '20 at 22:33
  • As it appears you are using multiple APK - which has been deprecated from the Google Play Store. See: [Publish Multiple APKs to Google Play Store](https://stackoverflow.com/a/48556005/295004) and https://developer.android.com/google/play/publishing/multiple-apks.html – Morrison Chang Jun 25 '20 at 23:21
  • If you have pure Java code, I don't see why you are building multiple APKs for different ABIs. Unless you are using C/C++ in your project, there is no need to build different APKs for different ABIs. Secondly, Android Studio will build multiple APKs, one for each ABI, you need to upload all of those to the Play Store. – Kartik Ohri Jun 26 '20 at 06:06
  • even if i produce multiple apk or single apk , without split all of them are armeabi packed armeabi-v7a i tried to upload http://prntscr.com/t6whv9 arm64-v8a also has the same armeabi http://prntscr.com/t6wi5s – Archit K Jun 26 '20 at 11:50

1 Answers1

0

Replace this Gradle with your app-level (build.gradle) and Generate new singed apk. I hope this apk will accept in Google play store.

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 29

    defaultConfig {
        applicationId "com.Sample.Example"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 11
        versionName "11.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }


    android {
        lintOptions {
            abortOnError false
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}



dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    implementation 'com.jakewharton:butterknife:10.2.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
    implementation 'com.airbnb.android:lottie:3.4.1'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation group: 'commons-io', name: 'commons-io', version: '2.7'
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation group: 'com.google.android.material', name: 'material', version: '1.3.0-alpha01'
    implementation 'com.jpardogo.googleprogressbar:library:1.2.0'
    implementation 'com.github.fodroid:XStatusBarHelper:v1.1'
    implementation 'org.litepal.android:core:1.3.0'
    implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation group: 'com.google.android.gms', name: 'play-services-ads', version: '19.1.0'
    implementation group: 'com.romainpiel.shimmer', name: 'library', version: '1.4.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    implementation 'com.facebook.android:audience-network-sdk:5.9.1'
    implementation 'com.facebook.shimmer:shimmer:0.5.0'
}
Noban Hasan
  • 593
  • 1
  • 7
  • 21
  • This was the first thing i ever did ,you just removed split feature , No it does not help i think it is one of the third party libraries which are not able to produce 64 bit version – Archit K Jun 27 '20 at 11:02