提问者:小点点

如何更改android应用程序的版本


我的主要班级:-

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
    }

}

表现:-

package="aaa.amit.com"
    android:versionCode="1"//that i have change android:versionCode="2"
    android:versionName="1.0" >//android:versionName="1.0.1"

    <uses-sdk
        android:minSdkVersion="8"

        android:targetSdkVersion="18" />

有人能告诉我如何更改我的版本吗?


共3个答案

匿名用户

您想更改哪个版本?如果要在商店中更新您的应用程序,您必须增加android: versionCode="1"。这对用户来说是不可见的。

如果您想向用户显示您增加了应用程序的版本,您也可以增加android: versionName="1.0",只需记住,增加versionCode是在商店中更新应用程序的强制要求。

匿名用户

只需尝试更改…在您的清单文件中

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.androidhacker.googlemapsv2"
    android:versionCode="2" <!-- 1 / 2 / 3 etc for version code @Thanks laalto ..-->
    android:versionName="1.1" > <!-- 1.1 / 1.2 etc for version name ..-->

Update:: 出口项目…

(1) Right click on project.
(2) Select Export.
(3) Now check option for android -> Export Android Application.
(4) Check your project name and click next.
(5)Now select option "Use existing keystore" and browse where you need to keep .apk file. Put password which was used for creating first built. click next and fallow other.

Now you can find your new .apk file at place where you located at point-5. 

就这样。你的工作结束了。

匿名用户

在android Studio中添加/更改版本代码和版本名称:

       versionCode 0
       versionName "0.0.2"

不仅在清单中,而且在模块的build. gradlee:: defaultConfig{}中最重要:像这样:

build. g radle(模块:我的应用)

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.xyz.mypackage"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 0
        versionName "0.0.1"
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
        }
     }

  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.1.1'
   }

请记住build. gradle比清单“更强”。意思是如果你有这些行

       versionCode 0
       versionName "0.0.2"

在build. gradle中,清单中的相同行将没有影响。如果您想从清单更新版本-请从build.gradle中删除此行。