Github.com/flutter/flu… The above is the official original text, and I will translate it word for word when I have time. Now I will briefly talk about the mixed compilation process of iOS.

(Readers who encounter problems, or come from other outdated translations, must start again from the first step.)

1. Switch to the Flutter Master branch first and then upgrade the SDK

1. Upgrade the flutter channel master 2. Upgrade the flutter channel masterCopy the code

2. Find your own path to a Flutter project

flutter_application_path = ".. /flutter_more/"The absolute path can be filled in, but the absolute path is not easy for the rest of the team to operateCopy the code

3. Add the code to your Podfile

flutter_application_path = ".. /flutter_more/"// This code is not the same as the outdated document. load File.join(flutter_application_path,'.ios'.'Flutter'.'podhelper.rb'Install_all_flutter_pods (Flutter_application_path) // Cocopods you should be better than me, I just touched it todayCopy the code
  1. Use pod install
Pod install // If an error occurs, please note if the third part is incorrectCopy the code

5. You can now launch the ios project directly. Here is the code to bind the Flutter bridge (I copied the code directly from the original one, you should understand this operation, and there are other ways to do this if the AppDelegate inherits other classes)

In AppDelegate.h:

#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>

@interface AppDelegate : FlutterAppDelegate
@property (nonatomic,strong) FlutterEngine *flutterEngine;
@end

This allows AppDelegate.m to be really simple, unless your host app needs to override other methods here:

#import <FlutterPluginRegistrant/GeneratedPluginRegistrant.h> // Only if you have Flutter Plugins

#include "AppDelegate.h"

@implementation AppDelegate

// This override can be omitted if you do not have any Flutter Plugins.
- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  self.flutterEngine = [[FlutterEngine alloc] initWithName:@"io.flutter" project:nil];
  [self.flutterEngine runWithEntrypoint:nil];
  [GeneratedPluginRegistrant registerWithRegistry:self.flutterEngine];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

@end
Copy the code

6. This is the end of the basis of the mix.