Приложение Flutter сбои на физических устройствах iOS при использовании shared_preferences, но работает на Android и SimIOS

Программируем под IOS
Ответить Пред. темаСлед. тема
Anonymous
 Приложение Flutter сбои на физических устройствах iOS при использовании shared_preferences, но работает на Android и Sim

Сообщение Anonymous »

Я сталкиваюсь с проблемой, когда мое приложение Flutter прекрасно работает на устройствах Android и симуляторе iOS, но оно сбои на физических устройствах iOS во время выполнения. Сбой, по -видимому, связан с пакетом shared_preferences , поскольку журналы ошибок указывают на shared_preferences_foundation .
Вот некоторые подробности о моей настройке:
Flutter SDK: 3.27.1

dart sdk: 3.6.0

shared_preferences< /code> Версия: я попробовал 2.0.15, но проблема сохраняется. >
php
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS

Ссылки на журнал аварии Shared_preferences_foundation и swift_getobjecttype function.
Более подробная информация из журнала сбоя:
"threads" : [
{
"triggered": true,
"id": 400563,
"threadState": {
"x": [
{"value": 0},
{"value": 144115192374745649, "symbolLocation": 144115188075855873, "symbol": "type metadata for SharedPreferencesPlugin"},
{"value": 4298889776, "symbolLocation": 0, "symbol": "type metadata for SharedPreferencesPlugin"},
{"value": 6596501960, "symbolLocation": 0, "symbol": "swift_getObjectType"},
...
]
}
}
]
< /code>
Очень сложно воспроизвести ошибку, так как это сбой на начале, так что это не вопрос кода, а зависимости, я думаю. < /p>
то, что я пробовал до сих пор: < /p>

[*] Понижение пакета Shared_preferences до более старой версии. < /li>
Запуск Flutter Clean и Flutter Pub get после каждого изменения.
[*] Проверка info.plist и podfile , чтобы убедиться в отсутствии проблем конфигурации.

Может ли это быть вызвано несовместимостью между shared_preferences < /code > и версия iOS? Существуют ли дополнительные конфигурации, необходимые для ared_preferences для правильной работы на физических устройствах iOS?
Может ли быть конфликт с другими зависимостями? < /ul>
это сбои с простой hello word, я делюсь здесь своим pubsec.yaml < /p>
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/arc ... nKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+16

environment:
sdk: ^3.5.4

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
url_launcher: ^6.1.7
image_picker: ^1.1.2
http: ^1.2.2
intl: ^0.20.1
shared_preferences: ^2.0.15
mime: ^2.0.0
http_parser: ^4.0.2
cookie_jar: ^3.0.1
font_awesome_flutter: ^10.2.1
socket_io_client: ^3.0.2

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8

dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.14.2

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0
flutter_icons:
android: true
ios: true
image_path: "assets/app_icon.png"

# 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 packages.
flutter:
assets:
- assets/background.png
- assets/background2.png
- assets/background3.png
- assets/background4.png
- assets/background5.png
- assets/background6.png
- assets/logo.png

# 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:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package

# 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/to/font-from-packageenter````


Подробнее здесь: https://stackoverflow.com/questions/793 ... nces-but-w
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «IOS»