2016-09-24 124 views
1

我正试图在谷歌上播放我的apk。 apk文件是unity3d。谷歌播放不会让我成为我已经有版本。我在google play上得到这个消息。你需要为你的APK使用不同的版本代码,因为你已经有了一个版本代码1.我已经重建了项目,并将版本更改为2.我还对android manifest脚本,我仍然无法上传apk文件。这里是我做了改变,所以我可以在谷歌播放上传脚本:您需要为您的APK使用不同的版本代码,因为您已经拥有版本代码为1的版本。如何更改版本?

{

<?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>

}

回答

0

无论你的版本代码is..add它由1

android:versionCode="X + 1" 
+0

它没有工作。 –

0

它在你的gradle这个文件,并且被写入到你的清单(如果你不使用gradle产出) 。

1

只需更改清单中的versionCode即可。您当前的versionCode为2,将其更改为3

更换

android:versionCode="2"

android:versionCode="3"

每次上传新版本,由1

增加您的versionCode

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

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