I'm trying to archive my flutter app in distributing it to testers first. I have made and added schemas in Xcode for different flavours of the app. I also use amplify_core plugin. First when I try to clean build it gave me an error saying
"Compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 16.0:"
After a little bit of researching I've made the apmlify_core min deployment target to 11 under runner in Xcode pods. Then the build was successful. but when I try to do an archive it gives me this error
"package:/main.dart: Error: No 'main' method found. Try adding a method named 'main' to your program."
I will paste my main.dart and one flavour dart file for reference. anyone can help me with his. ?
main.dart file
class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
final appRouter = AppRouter().router;
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
StreamProvider<EInternetStatus>(
create: (context) =>
ConnectionCheck().internetStatusController.stream,
initialData: EInternetStatus.iLoading,
),
],
child: MaterialApp.router(
debugShowCheckedModeBanner: AppEnvironment.flavour == EFlavour.fDev ||
AppEnvironment.flavour == EFlavour.fQa
? true
: false,
theme: FPTheme.lightTheme,
routerConfig: appRouter,
),
);
}
}
main_dev.dart file
Future<void> main() async {
AppEnvironment.setupEnv(EFlavour.fDev);
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
await AmplifyServices().configureAmplify();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack);
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
setUp();
runApp(MyApp());
}
im not sure what I do here wrong? if anyone can help me out with this it would be amazing