新发布的应用

时间:2018-01-29 15:51:43

标签: android google-play apk abi

我遇到多个分组abi上传到谷歌播放的问题,我已经尝试过以前的问题的解决方案,但他们对我没什么好处。

下面的

是我的build.gradle配置:

apply plugin: 'com.android.application'

android {
//    compileSdkVersion 24
//    buildToolsVersion '24.0.3'
    signingConfigs {
        config {
            keyAlias 'unikey'
            keyPassword '*****'
            storeFile file('E:/Projects/CompanyDroid/AppSigner/mykey.jks')
            storePassword '*****'
        }
    }
    compileSdkVersion 27
    //buildToolsVersion '23.0.1'
    defaultConfig {
        applicationId "com.aethtech.myapp"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config
    }
    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()
            include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'

            // Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk true
        }
    }
    project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]

    android.applicationVariants.all { variant ->
        variant.outputs.each { output ->
            output.versionCodeOverride =
                    project.ext.versionCodes.get(output.getFilter(
                            com.android.build.OutputFile.ABI), 0) * 10000000 + android.defaultConfig.versionCode
        }
    }
    buildTypes {
        release {
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            zipAlignEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
            versionNameSuffix '1.0'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.github.paolorotolo:appintro:4.1.0'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile 'com.google.android.gms:play-services-ads:+'
    testCompile 'junit:junit:4.12'
}

Google Play商店中的错误如下所示:

enter image description here

另一个:

enter image description here

版本代码或abi拆分有问题,我是android studio的新手,所以我无法找到解决这个问题的原因。

3 个答案:

答案 0 :(得分:0)

将您的targetSdkVersion更改为26,最新的targetSdkVersion26targetSdkVersion的{​​{1}}高于最新的27

参考:https://developer.android.com/about/versions/oreo/android-8.0-migration.html

有一件事记得,一旦你在Play商店上传发布apk,总是会比之前的版本更高地增加versionCode。

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
     applicationId "com.aethtech.myapp"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 3
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

或检查一下, 你在Play商店中使用多个apk吗?或者即使您使用的是一个apk但使用了splits gradle函数,也可以考虑" multiple" apk到游戏商店。我认为可以使用类似于此处描述的版本代码方案来避免错误。https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes

答案 1 :(得分:0)

您的gradle文件说:

// Specifies that we do not want to also generate a universal APK 
// that includes all ABIs.

但是它已经

universalApk true

您是否有可能上传通用APK,这个通用APK会影响您所有其他APK?

同样来自您的gradle文件我希望看到上传4个APK(每个原生ABI一个),但您上传的是2.这看起来也不错。

答案 2 :(得分:0)

  

您需要以这种格式放置Gradle。 (具体为 ABI版本    代码顺序

splits {

        // Configures multiple APKs based on ABI.
        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 and x86_64.
            // Resets the list of ABIs that Gradle should create APKs for to none.
            reset()
            // Specifies a list of ABIs that Gradle should create APKs for.
            include "x86", "x86_64", "armeabi", "arm64-v8a", "armeabi-v7a", "mips"

            // Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk true
        }
    }
ext.abiCodes = ['x86': 3, 'x86_64': 4, 'armeabi-v7a': 5, 'arm64-v8a': 6, armeabi: 1, mips: 2]