【问题标题】:Flutter App not installable from Google store for Android 12无法从适用于 Android 12 的 Google 商店安装 Flutter App
【发布时间】:2022-07-03 17:51:51
【问题描述】:

我正在尝试在 Google Play 控制台中开始对我的颤振应用程序进行内部测试。它适用于除 Android 12 以外的其他设备。在 Android 12 上,我无法安装该应用程序。但该应用程序在 Android 12 模拟器上运行完美。

我已经按照这个问题的说明进行操作 Flutter App not installable from Google store for Android 12 despite being set to targetSDK 31。因为它也不起作用,所以我创建了一个新的干净的 Flutter 项目并在没有更改任何内容的情况下上传它。结果是一样的:除搭载 Android 12 的设备外,所有设备均可下载该应用。

我的 build.gradle 文件:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 31

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "myAppId"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

颤振医生:

【问题讨论】:

标签: android flutter google-play google-play-console


【解决方案1】:

在获得应用审核后,它现在可以在开放测试中运行。

【讨论】:

    猜你喜欢
    • 2021-12-22
    • 1970-01-01
    • 2012-04-25
    • 2015-02-21
    • 2023-01-14
    • 1970-01-01
    • 2023-02-16
    • 2019-04-08
    • 2012-05-20
    相关资源
    最近更新 更多