首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >颤动释放Apk (应用程序未安装)错误

颤动释放Apk (应用程序未安装)错误
EN

Stack Overflow用户
提问于 2021-10-06 07:43:32
回答 1查看 1.2K关注 0票数 0

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

app/build.gradle

代码语言:javascript
复制
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了。

EN

回答 1

Stack Overflow用户

发布于 2021-10-06 19:52:41

我按照这个链接(https://docs.testfairy.com/FAQ/App_Not_Installed_Android_10.html)上的提示解决了这个问题,在我的例子中,第一个选项解决了我的问题,在卸载应用程序并重新启动手机后,我播放了apk pro设备,它工作了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69461669

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档