android - 您需要为您的 APK 使用不同的版本代码,因为您已经有一个版本代码为 1 的 APK。如何更改版本?

标签 android css google-play google-play-services

我正在尝试将我的 apk 上传到 google play。 apk 文件是 unity3d 。 Google Play 不会让我成为我已经拥有的版本。我在 google play 上收到这条消息。你需要为你的 APK 使用不同的版本代码,因为你已经有一个版本代码为 1 的版本。我已经重建元素并将版本更改为 2。我还在 android list 中进行了更改脚本,我仍然无法上传 apk 文件。以下是我修改过的脚本,以便我可以在 google play 上上传:

{

<?xml version="2.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="1.7" package="com.Be.Jackson" android:installLocation="preferExternal">
  <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/UnityThemeSelector" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">
    <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <activity android:name="com.google.games.bridge.NativeBridgeActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <!-- Required for Nearby Connections API -->
    <meta-data android:name="com.google.android.gms.nearby.connection.SERVICE_ID" android:value="" />
    <!-- the space in these forces it to be interpreted as a string vs. int -->
    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 643756129390" />
    <meta-data android:name="com.google.android.gms.games.unityVersion" android:value="\ 0.9.34" />
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    <activity android:exported="false" android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
  </application>
  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

{

<?xml version="2.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.Be.Jackson" android:installLocation="preferExternal" android:versionName="2.0" android:versionCode="2">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
  </application>
  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
</manifest>

最佳答案

只需更改 list 中的版本代码即可。您当前的 versionCode 是 2,将其更改为 3。

替换

android:versionCode="2"

android:versionCode="3"

每次上传新版本时,将您的版本代码递增 1。

您还应该尝试修改 build.gradle 中的 versionCode 和 versionName。

defaultConfig {
    applicationId "com.you.yourpackage"
    minSdkVersion XX
    targetSdkVersion XX
    versionCode 3      // new versionCode
    versionName "1.7"  // new versionName
}

关于android - 您需要为您的 APK 使用不同的版本代码,因为您已经有一个版本代码为 1 的 APK。如何更改版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39677815/

相关文章:

android - 如何在android :digits上允许空间

android - 通过改造按顺序将图像上传到 REST API

java - 建议的通知振动持续时间?

xhtml - 是否有任何解决方案可以在 firefox 3.5 及更低版本中获得对 CSS Gradient 的支持?

android - 如何检查我的应用程序是否可以从谷歌播放下载

android - Wifi点对点Voip通话申请

javascript - 为什么使用 Window.Print() 打印后不显示 CSS?

css - 绝对定位的 div 的相对定位同级已移至上方

android - 在 android 市场上发布自定义应用程序

android - 在 Android 模拟器中安装 Chrome for Android