【问题标题】:Flutter apk builds, installs but then will not openFlutter apk 构建、安装但随后无法打开
【发布时间】:2020-09-11 07:59:34
【问题描述】:

我正在尝试为我的颤振应用创建 apk。它在模拟器和设备上运行颤振运行时工作。

运行时: 颤振构建apk

获取成功和 apk。将 apk 复制到设备时,它会安装但无法打开。 (安装按钮打开后显示为灰色,在应用程序中查找应用程序会打开应用程序信息页面)。在多个设备上安装累了 apk。

flutter run --release 有效

我已按照步骤迁移到 Androidx 并检查了所有包 build.gradle 以确保所有包都是 compileSdkVersion 28。

我尝试在稳定版、master 和 beta 颤振分支上运行。

运行: flutter build apk --release 提供(在flutter beta分支上)

You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...                            2.8s
✓ Built build/app/outputs/flutter-apk/app-release.apk (21.2MB).

编辑: 情节变厚了xD。我可以从深层链接启动应用程序,但使用应用程序图标总是会启动到设置中。

【问题讨论】:

  • 这里有问题,有什么解决办法吗??

标签: android flutter


【解决方案1】:

添加以下代码

android\app\build.gradle 里面的安卓{ }

buildTypes {
    release {
        signingConfig signingConfigs.release

        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
    }
}

【讨论】:

  • 感谢您的回复!我试了一下,但遇到了同样的问题
【解决方案2】:

原来我安装了使用 compileSdkVersion 27 的包应用程序可用性。在该包的 build.gradle 中将其更改为 28 似乎可以修复它。

最简单的解决方案就是换掉那个包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 2016-10-22
    • 2020-05-15
    • 2018-08-10
    • 1970-01-01
    相关资源
    最近更新 更多