简体   繁体   English

Play商店中的Android应用有两个版本,旧版本和新版本

[英]Android app in play store has 2 versions the older and the new

The problem that I am facing is that In the play store I have my version 1.0.0 of the app that is made in ionic 3, well next we have done a react native app of the same and we change the version to 2.0.0. 我面临的问题是,在Play商店中,我有使用ionic 3制作的应用程序的版本1.0.0,接下来我们做了一个相同的react native应用程序,并将版本更改为2.0.0。 。 Now the thing is that some users only see the last version while others the majority see the older one the 1.0.0. 现在的问题是,有些用户只能看到最新版本,而其他大多数用户只能看到较旧的版本1.0.0。 I don't know if this is related to this code of the build.gradle 我不知道这是否与build.gradle的这段代码有关

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 27
        supportLibVersion = "27.1.1"
    }
 }

I think if i have the minSdkVerison to 16 it should work on all the android devices above that version but no. 我认为,如果我的minSdkVerison达到16,则应该可以在该版本以上的所有android设备上运行,但不能。 So maybe is not related to that can someone point me in the right direction. 因此,也许与此无关,有人可以指出我正确的方向。

Thanks in advance 提前致谢

UPDATE: Here is my AndroidManifest.xml 更新:这是我的AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ionicframework.mdp365">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/icon"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <meta-data android:name="com.facebook.sdk.ApplicationId"
          android:value="@string/facebook_app_id"/>
      <activity
        android:name=".MainActivity"
        android:label="Mdp365"
        android:screenOrientation="portrait"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
       <meta-data
     android:name="com.google.android.maps.v2.API_KEY"
     android:value="AIzaSyB77i0i5NdDUjXluZHyXQNroi2qB4wduWQ"/>
     <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}.provider"
        android:grantUriPermissions="true"
        android:exported="false">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/filepaths" />
    </provider>

    <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
    <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
  </service>


    </application>

</manifest>

And here is my app build.gradle: 这是我的应用程序build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.ionicframework.mdp365"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 3
        versionName "3.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }



}

dependencies {
    compile project(':react-native-share')
    compile project(':react-native-vector-icons')
    compile project(':react-native-splash-screen')
    compile project(':react-native-oauth')
    compile project(':react-native-maps')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-firebase')
    compile project(':react-native-fbsdk')
    implementation project(':react-native-firebase')
    implementation project(':react-native-maps')
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-firebase')
    implementation(project(':react-native-maps')){
       exclude group: 'com.google.android.gms', module: 'play-services-base'
       exclude group: 'com.google.android.gms', module: 'play-services-maps'
   }
   implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-oauth')
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules

      implementation "com.google.android.gms:play-services-base:16.0.1"
  implementation "com.google.firebase:firebase-core:16.0.6"
    implementation "com.google.firebase:firebase-messaging:17.3.4"
    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
    //implementation "com.google.firebase:firebase-auth:16.0.1"
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
 apply plugin: 'com.google.gms.google-services'
//com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true 

Here is my root project build.gradle 这是我的根项目build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 27
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.0.1'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories { 
        mavenLocal()
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

这是因为新版本支持的版本高于看不到新更新的用户的版本。

Since I can't update my comment anymore: 由于我无法再更新评论了:

If people are still using the older version of your app, they have to update it manually. 如果人们仍在使用旧版应用,则必须手动进行更新。 As an option in PlayStore you can choose to automate or not, version updates of your apps. 作为PlayStore中的一个选项,您可以选择是否自动执行应用程序的版本更新。 I'm sure the older version of your app is not available anymore, if it got an update. 我确定您的应用程序的旧版本已更新,因此不再可用。 Of course your customers phones need to support your app by Android version to see your app in store. 当然,您的客户手机需要按Android版本支持您的应用,才能在商店中看到您的应用。

Responsible for this is your minSdkversion . 负责您的minSdkversion It tells the Store which Android API version is min required on the users phone. 它告诉商店用户手机上至少需要哪个Android API版本。 Your minSdkversion (16) is API version 16 which is Android Version 4.1.x - Codename Jelly Bean . 您的minSdkversion (16)是API版本16,即Android版本4.1.x-代号Jelly Bean

When publishing your app you should deactivate the APK of the old version (version 1) and only have version 2 active. 发布应用时,您应该停用旧版本(版本1)的APK,并且仅激活版本2。 Then everyone will get version 2. 然后每个人都将获得版本2。

However, if some users are seeing version 1 it means version 2 is not compatible with their phone, as Play will not deliver an incompatible APK. 但是,如果某些用户看到的是版本1,则表示版本2与他们的手机不兼容,因为Play不会提供不兼容的APK。 You might want to investigate why that is. 您可能想调查原因。 We can only help you if you post your AndroidManifest.xml file and your build.gradle. 我们只有在发布您的AndroidManifest.xml文件和build.gradle时才能为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 较旧版本的应用下载Android Play商店 - Older version app downloads Android play store 如果新版本的 API 更高,Android play store 是否允许下载旧版本的应用程序? - Does Android play store allow old version of an app to be downloaded if the new version has higher API? Android Studio在旧版本上调用新方法 - Android Studio Calling new methods on older versions 我的应用程序无法在Android 7.0和更早版本上运行 - My app not working on Android 7.0 and older versions 以编程方式更改旧 android 版本上的应用程序语言 - Programmatically changing app language on older android versions 某些设备中的 PlayStore 应用程序仍显示旧版本,而新版本已上线并可在 Play 商店中使用 - PlayStore app in some devices still showing older version while new version is live and available on play store 在 Play 商店上传一个新的 android 应用程序以下载另一个应用程序 - upload an new android app in Play Store to download another app 新的 Android 应用程序可以取代 Play 商店中的现有应用程序吗? - Can a new Android app replace existing app in the play store? Google Play商店中的多个版本的应用 - Multiple versions of app in Google Play Store Google Play 商店正在下载旧版本的应用程序 - Google Play Store downloading old versions of app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM