I can run my app on android simulator and phisical gadget too nicely, I can generate apk as nicely however when I attempt to run my app on iOS I get error after Catcher2 in my fundamental.dart
void fundamental() async {
closing navigatorKey = GlobalKey();
WidgetsFlutterBinding.ensureInitialized();
// Init Hive earlier than get storage
await Hive.initFlutter();
Hive.registerAdapter(RefreshTokenAdapter());
RefreshToken storage = RefreshToken();
await storage.openBox();
// Initialize App
await Firebase.initializeApp(
// title: "dovevivo",
// choices: DefaultFirebaseOptions.currentPlatform,
);
// Setting FCM Token on storage
FirebaseMessaging.occasion.getToken().then((worth) async {
String? fcmToken = worth;
storage.setFcmToken(fcmToken ?? "");
print('FCMToken:' + fcmToken!);
});
// Allow Android/iOS Push Notification config with redirects
await PushNotificationConfig(App.navigatorKey).setupInteractedMessage();
// Verify that Localization is enabled
await EasyLocalization.ensureInitialized();
// Permissions requests
await Permission.digicam.request();
await Permission.photographs.request();
await Permission.notification.isDenied.then((worth) async {
if (worth) {
await Permission.notification.request();
}
});
await SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown],
);
if (kDebugMode && Platform.isAndroid) {
await AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true);
}
// Bloc.observer = AppBlocObserver();
closing sentryHandler = await makeSentryHandler();
closing customParameters = await makeCustomParameters();
closing catcherDebugOptions = Catcher2Options(
SilentReportMode(),
[ConsoleHandler()],
customParameters: customParameters,
);
closing catcherReleaseOptions = Catcher2Options(
SilentReportMode(),
[sentryHandler],
customParameters: customParameters,
);
Catcher2(
rootWidget: const App(),
debugConfig: catcherDebugOptions,
releaseConfig: catcherReleaseOptions,
navigatorKey: App.navigatorKey,
ensureInitialized: true,
);
}
Future makeSentryHandler() async {
closing packageInfo = await PackageInfo.fromPlatform();
closing model = packageInfo.model;
closing buildNumber = packageInfo.buildNumber;
return CustomSentryHandler(
sentry.SentryClient(
sentry.SentryOptions(dsn: AppConfig.SENTRY_DSN),
),
customRelease: '$model+$buildNumber',
);
}
Future
my app.dart:
bool? isLoggedIn;
class App extends StatelessWidget {
static closing navigatorKey = GlobalKey();
static closing bottomBarKey = GlobalKey();
static closing mainNavigationDelegate =
MainRouterDelegate(MainNavigationStack([const MainNavigation.splash()]));
static closing mainNavigationParser = MainRouterInformationParser();
static Locale? get currentLocale => App.navigatorKey.currentContext?.locale;
closing DependencyFactory dependencyFactory;
const App({
Key? key,
this.dependencyFactory = const DependencyFactoryImpl(),
}) : tremendous(key: key);
void authListener(BuildContext context, AuthLoginInAppState state) async {
await state.maybeWhen(
authError: (_) => showDialog(
context: App.navigatorKey.currentContext!,
builder: (context) => AlertDialog(
content material: Textual content(tr('session_expired')),
actions: [
TextButton(
onPressed: Navigator.of(context).pop,
child: Text(tr('ok')),
)
],
),
),
orElse: () {},
);
mainNavigationDelegate.stack.gadgets = [const MainNavigation.login()];
}
@override
Widget construct(BuildContext context) {
return DependencyProvider(
dependencyFactory: const DependencyFactoryImpl(),
youngster: Builder(
builder: (context) => LocalizationWrapper(
youngster: Builder(
builder: (context) => MultiBlocListener(
listeners: [
BlocListener(
listenWhen: (previousState, currentState) =>
previousState.maybeWhen(
loggedIn: (_) => currentState.maybeWhen(
loggedOut: () => true,
authError: (_) => true,
orElse: () => false,
),
orElse: () => false),
listener: authListener,
),
BlocListener(
listenWhen: (previous, current) => current.maybeWhen(
fetchState: (state) => state.maybeWhen(
loaded: (_) => true,
orElse: () => false,
),
orElse: () => false,
),
listener: (context, state) => state.maybeWhen(
fetchState: (state) => state.maybeWhen(
loaded: (model) =>
context.setLocale(model.language.toLocale),
orElse: () {},
),
orElse: () {},
),
)
],
youngster: DvNavigatorObservers(
youngster: FlowControllersProvider(
youngster: MaterialApp.router(
routerDelegate: mainNavigationDelegate,
routeInformationParser: mainNavigationParser,
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
themeMode: ThemeMode.gentle,
theme: AppTheme.gentle,
darkTheme: AppTheme.darkish,
builder: (context, youngster) {
closing existingFactor =
MediaQuery.of(context).textScaleFactor;
LayoutUtils.updateScaleFactor(
context,
existingFactor: existingFactor,
);
return MediaQuery(
knowledge: MediaQuery.of(context).copyWith(
textScaleFactor: LayoutUtils.textScaleFactor,
),
youngster: youngster!,
);
},
),
),
),
),
),
),
),
);
}
}
the error:
enter picture description right here
the Logs:
flutter: [2024-09-06 10:36:03.064401 | Catcher 2 | INFO] ---------- ERROR ----------
flutter: [2024-09-06 10:36:03.064442 | Catcher 2 | INFO] Stack Overflow
flutter: [2024-09-06 10:36:03.064501 | Catcher 2 | INFO]
flutter: [2024-09-06 10:36:03.064626 | Catcher 2 | INFO] ------- STACK TRACE -------
flutter: [2024-09-06 10:36:03.065011 | Catcher 2 | INFO] #0 new TextTreeConfiguration (bundle:flutter/src/basis/diagnostics.dart:229:3)
flutter: [2024-09-06 10:36:03.065069 | Catcher 2 | INFO] #1 singleLineTextConfiguration (bundle:flutter/src/basis/diagnostics.dart:695:59)
flutter: [2024-09-06 10:36:03.065116 | Catcher 2 | INFO] #2 singleLineTextConfiguration (bundle:flutter/src/basis/diagnostics.dart)
flutter: [2024-09-06 10:36:03.065162 | Catcher 2 | INFO] #3 DiagnosticsNode.textTreeConfiguration (bundle:flutter/src/basis/diagnostics.dart:1735:16)
flutter: [2024-09-06 10:36:03.065206 | Catcher 2 | INFO] #4 TextTreeRenderer._debugRender (bundle:flutter/src/basis/diagnostics.dart:1147:47)
flutter: [2024-09-06 10:36:03.065251 | Catcher 2 | INFO] #5 TextTreeRenderer.render (bundle:flutter/src/basis/diagnostics.dart:1125:14)
flutter: [2024-09-06 10:36:03.065294 | Catcher 2 | INFO] #6 DiagnosticsNode.toStringDeep. (bundle:flutter/src/basis/diagnostics.dart:1782:9)
Typically after I reload the app it really works fantastic, specifically after I run the app with flutter dev instruments on browser opened. Possibly it is one thing about MaterialApp ? I am caught on this
I replace Catcher with Catcher2 and in android it really works fantastic. That is my flutter physician:
[✓] Flutter (Channel secure, 3.19.0, on macOS 14.6.1 23G93 darwin-arm64, locale en-IT)
• Flutter model 3.19.0 on channel secure at /Customers/alberto.callegari/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision bae5e49bc2 (7 months in the past), 2024-02-13 17:46:18 -0800
• Engine revision 04817c99c9
• Dart model 3.3.0
• DevTools model 2.31.1
[✓] Android toolchain - develop for Android units (Android SDK model 34.0.0)
• Android SDK at /Customers/alberto.callegari/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Customers/alberto.callegari/Library/Android/sdk
• Java binary at: /Functions/Android Studio.app/Contents/jbr/Contents/Dwelling/bin/java
• Java model OpenJDK Runtime Setting (construct 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Functions/Xcode.app/Contents/Developer
• Construct 15F31d
• CocoaPods model 1.15.2
[✓] Chrome - develop for the online
• Chrome at /Functions/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (model 2024.1)
• Android Studio at /Functions/Android Studio.app/Contents
• Flutter plugin may be put in from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin may be put in from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java model OpenJDK Runtime Setting (construct 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (model 1.92.2)
• VS Code at /Functions/Visible Studio Code.app/Contents
• Flutter extension model 3.96.0
[✓] Community assets
• All anticipated community assets can be found.
• No points discovered!