gpt4 book ai didi

android - Flutter Release Apk (App Not Installed ) 报错

转载 作者:行者123 更新时间:2023-12-05 04:43:55 25 4
gpt4 key购买 nike

我要使用发布命令安装发布应用程序构建flutter build apk --release 但是当我尝试安装该 apk 时,它显示应用程序未安装。请帮我解决这个问题。我也曾尝试为每个 abi 构建 apk,但问题仍然存在。我正在使用 fvm 构建 apk 和 Flutter 版本 2.2.2。

应用程序/build.gradle

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 FileNotFoundException("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"
apply plugin: 'com.google.gms.google-services'


def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


android {
compileSdkVersion 30

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

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
applicationId "package_name"
minSdkVersion 20
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.50"
implementation platform('com.google.firebase:firebase-bom:26.4.0')
implementation "androidx.browser:browser:1.3.0"
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-messaging'
}

还尝试为 apk 生成新的 keystore ,但同样的问题。我已经尝试过签名和未签名的 apk。

最佳答案

我按照此链接 (https://docs.testfairy.com/FAQ/App_Not_Installed_Android_10.html) 上的提示解决了这个问题,在我的情况下,第一个选项解决了我的问题,在卸载应用程序并重新启动我的手机后,我玩了 apk pro 设备并且它有效。

关于android - Flutter Release Apk (App Not Installed ) 报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69461669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com