Flutter ios error: expected '(' after 'if' if #available(iOS 10.0, *) {

334 views Asked by At

my app works for android, trying to run in iOS. I am getting this error from flutter.

 /Users/mdzainalabedin/carevan_app/ios/Runner/AppDelegate.m:10:6: error: expected '(' after 'if'
  if #available(iOS 10.0, *) {
     ^
1 error generated.

My flutter version

Framework • revision 1aafb3a8b9 (4 weeks ago) • 2020-11-13 09:59:28 -0800

Engine • revision 2c956a31c0 Tools • Dart 2.10.4

Anyone can help what is the problem?

Thank you.

1

There are 1 answers

0
Hkm Sadek On

I found the solution. i think it was simple programming problems. I replaced the code with

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      [GeneratedPluginRegistrant registerWithRegistry:self];
      // Override point for customization after application launch.
         return [super application:application 
   didFinishLaunchingWithOptions:launchOptions];
 }

@end