integration

The integration of Flutter Boost produced by Xianyu is very simple without any problems. For details, refer to Github of Flutter_Boost for detailed instructions and examples, which are not described here:

Github.com/alibaba/flu…

Compared with Flutter official recommended integration, flutterBoost has the following advantages:

The official integration scheme has a number of drawbacks: - logs cannot be exported to the native end; - Memory leaks are a problem, boost can stabilize memory - Native calls flutter, flutter calls native, channel encapsulation, making development more convenient; - At the same time, the page life cycle management, also combed fairly neatCopy the code

packaging

After the flutter project is successfully integrated into the iOS project, Debug runs all functions and jumps are normal. Then the Adhoc packaging starts and pits start to appear again:

Compile flutter_module with the command flutter build ios and then package it in the ios project.

/Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework/App: signed bundle with Mach-O universal (x86_64 arm64) [io.flutter.flutter.app] /Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework/Flutter: replacing existing signature /Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Flutter.framework/Flutter: signed bundle with Mach-O universal (armv7 x86_64 arm64) [io.flutter.flutter] fatal error: lipo: -extract armv7 specified but fat file: /Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework/App does not contain that architecture Failed to extract armv7 for /Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework/App. Running lipo -info: Architectures in the fat file: /Users/ios/Library/Developer/Xcode/DerivedData/Runner-arwzutrlpazzxehkoznuqlffxqkq/Build/Intermediates.noindex/ArchiveIn termediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework/App are: x86_64 arm64 Command PhaseScriptExecution failed with a nonzero exit codeCopy the code

App. Framework /App does not contain that architecture Failed to extract armv7. The App. Framework compiled by the Flutter project does not contain the ARMV7 processor architecture, only x86_64 and ARM64 architectures, so you can just remove the ARMV7 when packaging. To do this, change the Release in Build Active Architecture Only to Yes, and then select the specific device from the deviceSince the reference:Github.com/flutter/flu…

Packing succeeded

Since the iOS 64-bit architecture is now ubiquitous (before the iPhone5s, devices were 32-bit and few people still use it), it is possible to force only 64-bit packaging when packaging, i.e. not building armv7 and armv7s. Set Build Active Architecture Only to YES in Xcode->Target->Build Setting. The device I am currently connected to is iPhone7 and the Architecture is ARM64. And set Vaild Architecture to ARM64, ARM64E; (note: Vaild Architecture option is no longer available in Xcode12)

Then we review the Architectures directive set in Xcode:

Build Active Architecture Only

Specifies whether to compile only the instruction set supported by the currently connected device. When set to YES, this property is set to YES for faster compilation with debug, which compiles only the current architecture version, whereas when set to no, it compiles all versions. The compiled version is backward compatible, with instruction set matching from high to low (arm64 > ARMV7s > ARMV7) on connected devices. For example, if you set this value to yes, the iphone4 will compile the armv7 version, which will work on the iphone5 but will not work on armv6 devices. Therefore, you can set it to yes for debug and no for release to adapt to different devices.

If the size of the IPA installation package is required, you can reduce the number of instruction sets for the installation package to reduce the size of the package as much as possible. Of course, this will cause performance loss of some devices, of course, in common applications this is almost invisible, at least not a threat to the user physical examination.

The model corresponding to the instruction set:

IPhone XS Max, iPhone XS Max, iPhone XR 2017 A11 chip ARM64: IPhone 8, iPhone 8 Plus, and iPhone X 2016 A10 chip Arm64: IPhone 6S, 6S Plus 2014 A8 Chip ARM64: iPhone 6, iPhone 6 Plus 2013 A7 chip ARM64: iPhone 5S ARMV7s: IPhone5 iPhone5C iphone4 (iPad with Retina Display) armV7: IPhone4 | iPhone4S | iPad | iPad2 | iPad3(The New iPad) | iPad Mini | iPod Touch 3G | iPod Touch4 Simulator 64-bit processor tests require x86_64 architecture, real 32-bit processors require ARMV7, or REAL 64-bit processors require ARMV7S architecture.Copy the code