【发布时间】:2021-10-18 11:38:57
【问题描述】:
我发布了一个安卓应用。我想进行一些更新,更新后,它开始冻结,从白屏开始。当我调试时,它在从商店下载后冻结的同一设备中完美运行。在模拟器中,我从商店下载了应用程序,它可以工作。可能是什么问题造成的?
我使用命令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 包引起的。我的主要工作是.read,正如我所见,很多人都面临这个问题。我现在要做的是,只要找到工作版本,我会尝试更改flutter_secure_storage 版本。
【问题讨论】:
-
你确定你没有将flutter_secure_storage的任何密钥初始化为空字符串吗?
-
@GuilhermeV。我很确定,但我会仔细检查。此外,如果是这种情况,相同的代码、相同的构建会在某些设备上产生错误,而与其他一些设备完美配合。不是每个设备都会出现这种情况吗?
标签: android flutter google-play android-app-bundle