android - Problema更新和上传我的apk

标签 android xml versioning

大家好,这是我对我的应用程序进行的第一次更新...我正在阅读并注意到我需要在 manifest.xml 中更改我的应用程序的版本代码和版本名称,我这样做并单击构建-> 生成签名的 APK 然后在开发者控制台中选择我的应用程序并在左侧菜单中单击 APK 然后上传新的 APK 并选择我新生成的 APK 但我不断收到相同的错误:

Upload error You must use another version code for your APK because you already have a file with the version code 1.

但我不知道为什么我会收到此错误这是我的 manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ve.net.gorydev.bachaqueofamilia"
    android:versionCode="2"
    android:versionName="1.1">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我应该改变什么??记住这是我的第一次更新

最佳答案

versionCode和versionName也在你的app/build.gradle中定义;在那里定义它们,你应该没有问题。

android {
     defaultConfig{
          versionCode 2
          versionName "1.1"
     }
}

关于android - Problema更新和上传我的apk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37152316/

相关文章:

c++ - GLib - C++ 中的主事件循环

javascript - 附加到 DOM 时 XML 属性变为小写

ios - 如何将 NSCoder 与版本化类一起使用

xml - Xcode 8 中缺少 libsystem_symptoms.dylib

Java 项目 : should . 类路径 .project 文件被提交到存储库?

c# - 如何在我的应用程序中显示上次构建的内部版本号和/或日期时间?

android - 如何使用 addHeaderView() 在单个 ListView 中添加多个标题?

android admob 集成问题 - 不允许使用字符串类型

java - 在水平 LinearLayout 中膨胀垂直线性布局返回宽度和高度 0

java - Jaxb:处理剩余 Web 服务响应中的可选元素