简体   繁体   English

还安装了来自 Play 商店的应用时,由于冲突而未安装应用

[英]App not installed due to conflict when app from play store is also installed

I'm running into an odd issue and not at all sure why.我遇到了一个奇怪的问题,完全不知道为什么。

I'm using firebase app distribution to install development-grade versions of my app and whenever I try to install a dev version of my app, it won't install claiming that the app exists already, but it doesn't.我正在使用 firebase 应用程序分发来安装我的应用程序的开发级版本,并且每当我尝试安装我的应用程序的开发版本时,它不会安装声称该应用程序已经存在,但事实并非如此。

I have the app from the store installed and upon uninstalling that, the app will then install but I don't understand why as both have different applicationIds.我安装了商店中的应用程序,卸载后,该应用程序安装,但我不明白为什么两者都有不同的 applicationId。

the store version has: com.example.myapp & the dev version has com.example.myapp.preview and the app name is also different as is the version code and version name.商店版本有: com.example.myapp和开发版本有com.example.myapp.preview并且应用程序名称也不同,版本代码和版本名称也不同。

I don't get what they seem to share that is causing it to not allow both of them to coexist.我不明白他们似乎分享了什么导致它不允许他们两个共存。

Not sure if this is important, but when I try to install the dev version, play protect will pop-up claiming the app is unknown and to be sure you trust it.不确定这是否重要,但是当我尝试安装开发版时,播放保护会弹出声称该应用程序未知并确保您信任它。

I'm hoping someone can steer me in a direction on solving this as I'm simply lost on what's causing the conflict.我希望有人可以引导我解决这个问题,因为我只是迷失了导致冲突的原因。

here is the relevant gradle config:这是相关的gradle配置:

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.myppp"
        targetSdkVersion 32
        minSdkVersion 26

        versionCode verCode
        versionName "4.2.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        development {
            storeFile file("../keystore/development.jks")
            storePassword System.getenv("DEV_SIGNING_STORE_PASSWORD")
            keyAlias System.getenv("DEV_SIGNING_KEY_ALIAS")
            keyPassword System.getenv("DEV_SIGNING_KEY_PASSWORD")
        }
        debug {
            storeFile file("../keystore/debug.jks")
            storePassword System.getenv("DEBUG_SIGNING_STORE_PASSWORD")
            keyAlias System.getenv("DEBUG_SIGNING_KEY_ALIAS")
            keyPassword System.getenv("DEBUG_SIGNING_KEY_PASSWORD")
        }
        release {
            storeFile file("../keystore/prod.jks")
            storePassword System.getenv("PROD_SIGNING_STORE_PASSWORD")
            keyAlias System.getenv("PROD_SIGNING_KEY_ALIAS")
            keyPassword System.getenv("PROD_SIGNING_KEY_PASSWORD")
        }
    }

    buildTypes {
        development {
            versionNameSuffix "-DEV"
            minifyEnabled false
            applicationIdSuffix '.preview'
            debuggable true
            signingConfig signingConfigs.development

            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }
        }
        debug {
            versionNameSuffix "-DEBUG"
            minifyEnabled false
            applicationIdSuffix '.debug'
            signingConfig signingConfigs.debug

            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }
        }
        release {
            signingConfig signingConfigs.release

            // Enables code shrinking, obfuscation, and optimization for only your project's release build type.
            minifyEnabled true

            // Enables resource shrinking, which is performed by the Android Gradle plugin.
            shrinkResources true

            // Includes the default ProGuard rules files that are packaged with the Android Gradle plugin.
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            // Makes crash reports readable
            // @see https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android
            firebaseCrashlytics {
                mappingFileUploadEnabled true
            }
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    packagingOptions {
        resources {
            excludes += ['META-INF/*.kotlin_module']
        }
    }
    kotlinOptions {
        jvmTarget = '11'
        freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
    }
    buildFeatures {
        viewBinding true
    }
    lint {
        abortOnError true
    }
}

I have discovered my issue, it appears I was reusing the same file provider identifier, I made that more dependent on the application id and now I'm able to install the dev app alongside my store version.我发现了我的问题,看来我正在重用相同的文件提供程序标识符,我使它更加依赖于应用程序 ID,现在我可以将开发应用程序与我的商店版本一起安装。

I also has add product flavors as I saw a few SO answers claim that's a better way to go about what I was looking to do.我还添加了产品风味,因为我看到一些 SO 答案声称这是完成我想做的事情的更好方法。

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

相关问题 Android:安装APK后从Play商店重定向到Android应用 - Android: Redirect to android app from play store when apk is installed 深层链接 - 从 Play 商店安装应用时获取数据 - Deep linking - Fetch data when app installed from play store 从 Google Play 商店安装应用程序时崩溃 - App is crashing when installed from Google Play store 从Play商店安装应用程序时,Android BroadcastReceiver无法正常工作 - Android BroadcastReceiver not working when app is installed from play store 从 Play 商店更新手动安装的应用 - Update manually installed app from Play Store 检测是否从 Play 商店安装了应用程序 - Detect if an app is installed from Play store 应用内结算-未安装Play商店应用时该怎么办? - In-App Billing - What to do when the Play Store app is not installed? 如果未安装应用程序,如何检查是否已从我的应用程序安装了应用程序? - how to check whether an app is installed from my app if the app is not installed go to play store? 通过单击浏览器或邮件应用程序中的链接,在Android中未安装应用程序时打开Play商店 - open play store when app not installed in android by clicking the link from browser or mail App 应用:从官方Google Play商店安装还是从磁盘安装? - App: installed from official Google Play Store or from disk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM