我仅在测试设备iPhone 5(10.1.1)上收到“ FormatException:无效的基数16”。使用shared_preferences:^ 0.4.3插件。在所有其他设备和模拟器上都能正常工作。
有人知道此问题的解决方法吗?谢谢。
class _MyProfileHomePageState extends State<MyProfileHomePage> {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); //Line 44
FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
ProfileDataModel _profileDataModel;
String _fullName;
String _emailID;
...
..
.
}
//错误日志...
2018-10-24 17:43:18.552844 Runner[460:162775] [VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
FormatException: Invalid radix-16 number
ffffffffa20ecb9b
#0 int._throwFormatException (dart:core/runtime/libintegers_patch.dart:130:5)
#1 int._parse (dart:core/runtime/libintegers_patch.dart:104:14)
#2 int.parse (dart:core/runtime/libintegers_patch.dart:61:12)
#3 StandardMessageCodec.readValueOfType (package:flutter/src/services/message_codecs.dart:396:22)
#4 StandardMessageCodec.readValue (package:flutter/src/services/message_codecs.dart:365:12)
#5 StandardMessageCodec.readValueOfType (package:flutter/src/services/message_codecs.dart:432:39)
#6 StandardMessageCodec.readValue (package:flutter/src/services/message_codecs.dart:365:12)
#7 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:546:27)
#8 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
<asynchronous suspension>
#9 SharedPreferences.getInstance (package:shared_preferences/shared_preferences.dart:24:62)
<asynchronous suspension>
#10 new _MyProfileHomePageState (package:callpages/callpages_pages/MyProfileHomePage.dart:44:56)