[英]Flutter my app stuck at white screen after downloading from play store in some devices
我为 android 发布了一个应用程序。我想进行一些更新,更新后,它开始冻结在白屏中。 当我调试时,它在从商店下载后冻结的同一设备中完美运行。 在模拟器中,我从商店下载了该应用程序并且它可以运行。 可能是什么问题导致的?
我使用命令flutter build appbundle --obfuscate --split-debug-info=somepath
build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.5'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
pubspec.yaml:
environment:
sdk: ">=2.10.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
http: ^0.13.1
url_launcher: ^6.0.2
flutter_secure_storage: ^3.3.5
shared_preferences: ^2.0.5
provider: ^5.0.0
toast: ^0.1.5
onesignal_flutter: ^2.6.2
fl_chart: ^0.20.1
intl: ^0.17.0
device_info: ^2.0.0
synchronized: ^3.0.0
firebase_core: ^1.0.3
firebase_performance: ^0.6.0+2
flutter_localizations:
sdk: flutter
workmanager: ^0.4.0
get_it: ^7.1.3
image_picker: ^0.8.0+3
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
google_fonts: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
generate: true
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/
# - images/a_dot_ham.jpeg
fonts:
- family: Roboto
fonts:
- asset: fonts/Roboto-Medium.ttf
- asset: fonts/Roboto-Regular.ttf
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
我试图让我的 gradle 版本 3.5.1 我也试图删除我添加的包但是从商店下载时它仍然冻结。
编辑:当应用程序启动时,我在 logcat 中看到该错误:
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(Exception encountered, read, javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT
at com.android.org.conscrypt.NativeCrypto.EVP_CipherFinal_ex(Native Method)
at com.android.org.conscrypt.OpenSSLCipher$EVP_CIPHER.doFinalInternal(OpenSSLCipher.java:602)
at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:365)
at javax.crypto.Cipher.doFinal(Cipher.java:2055)
at c.b.a.b.b.b(Unknown Source:32)
at c.b.a.a.b(Unknown Source:11)
at c.b.a.a.d(Unknown Source:7)
at c.b.a.a.a(Unknown Source:0)
at c.b.a.a$b.run(Unknown Source:134)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.os.HandlerThread.run(HandlerThread.java:67)
, null)
编辑 2:当我查找时,这可能是由于flutter_secure_storage
package 引起的。我正在我的 main 中执行.read
,正如我所见,许多人都遇到了这个问题。 我现在做的是,只要找到可用的版本,我就会尝试更改flutter_secure_storage
版本。
您需要在AndroidManifest.xml
中允许 HTTP traffic.network 访问权限。
导致此错误的最常见原因是设备的 android API 版本。
解决此问题的步骤:
将targetSdkVersion
和compileSdkVersion
都升级到最新版本(答案贴30是最新版本)。
使用终端显示错误的设备以发布模式运行应用程序
flutter 运行——发布
.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.