version code shows different, from app grade file version code, when uploading to app store as aab

流过昼夜 提交于 2021-02-08 08:51:06

问题


When uploading an aab to the android play store console the versionCode is showing a much higher and completely different number than expected. The version Code is not showing as written in the gradle (targetSdkVersion) file of the app like it does when uploaded as a single apk.

I've built several apks in the past. I wanted to decrease apk size for users. to accomplish this I've built my app as an aab and successfully uploaded the file into firebase console. The problem manifests itself at this point. Thought the bundle is successfully uploaded, the version code is incorrect and I would like it to match the desired gradle version number

build.gradle

   defaultConfig {...
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 27
        versionName "3.0.9"
    }
...


after uploading aab version code shows: 3145755
expecting version code: 27

回答1:


I found a solution that worked. It turns out not only was the aab not getting the right version code, but neither were the apks. somewhere along the way this code had been changed in the app build.gradle file:

  • Set this to true to create two separate APKs instead of one:
    • An APK that only works on ARM devices
    • An APK that only works on x86 devices
  • The advantage is the size of the APK is reduced by about 4MB.
  • Upload all the APKs to the Play Store and people will download
  • the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = true <------------------- (should be false)

so there you have it. don't set that to true whatever you do.



来源:https://stackoverflow.com/questions/57598510/version-code-shows-different-from-app-grade-file-version-code-when-uploading-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!