简体   繁体   中英

Uploading APK to google play console doesn't work

Problem I am trying to upload my app to the google play store, but when I do I get an error saying,

Upload failed
You need to use a different version code for your APK because you already have one with version code 1.

I don't know why this is because this is the first version of my app to go onto the google store. I would love some help fixing this!

app.json

{
   "expo": {
    "name": "Phoenix",
    "icon": "./CandidtwoImages/Phoenixlogo.png",
    "version": "0.1.0",
    "slug": "Phoenix",
    "sdkVersion": "21.0.0",
    "ios": {
      "bundleIdentifier": "com.giise.phoenix"
    },
    "android": {
      "package": "com.giise.phoenix"
    }
   }
 }

I had the same issue, and none of these solved it.

The solution:

In app.json

  "expo": {
     expo stuff
  },
  "android": {
     "versionCode": 2   
  },

put in versionCode and update to 2. It must be an integer (notice not in quotes)

You need to increase versionCode in build.gradle :

 defaultConfig {
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

versionCode - internal version number used to identified version on Google Play

versionName - version number shown to users

Details here : https://developer.android.com/studio/publish/versioning.html

This happen because the frist time you upload an APK, it will automatically set as version 1, (in android studio also set version 1 - you can see at build.gradle). So you have to change version in build.gradle frist than generate and upload. Don't worry

To update your app on store you need to update/change your version number too.

In expo this can be done through app.json version prop.

To update your app you can use expo's update feature too if you didn't change any native data or sdkVersion etc.

Form Documentation of EXPO

For the most part, when you want to update your app, just Publish again from exp or XDE. Your users will download the new JS the next time they open the app. There are only a couple reasons why you might want to rebuild and resubmit the native binaries:

  • If you want to change native metadata like the app's name or icon
  • If you upgrade to a newer sdkVersion of your app (which requires new native code)

To keep track of this, you can also update the binary's versionCode and buildNumber. It is a good idea to glance through the app.json documentation to get an idea of all the properties you can change, eg the icons, deep linking url scheme, handset/tablet support, and a lot more.

Change the AndroidManifest file with the new version code.

<manifest 
          android:versionCode="1.1"
          android:versionName="1.1">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM