@@ -66,7 +66,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
6666 String content = pubspec.readAsStringSync ();
6767 content = content.replaceFirst (
6868 '\n dependencies:\n ' ,
69- '\n dependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n ' ,
69+ '\n dependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n connectivity: 3.0.3 \n ' ,
7070 );
7171 pubspec.writeAsStringSync (content, flush: true );
7272 await inDirectory (projectDir, () async {
@@ -284,6 +284,21 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
284284 'device_info' ,
285285 );
286286 await _checkBitcode (pluginFrameworkPath, mode);
287+ if (! await _linksOnFlutter (pluginFrameworkPath)) {
288+ throw TaskResult .failure ('$pluginFrameworkPath does not link on Flutter' );
289+ }
290+
291+ final String transitiveDependencyFrameworkPath = path.join (
292+ outputPath,
293+ mode,
294+ 'Reachability.xcframework' ,
295+ localXcodeArmDirectoryName,
296+ 'Reachability.framework' ,
297+ 'Reachability' ,
298+ );
299+ if (await _linksOnFlutter (transitiveDependencyFrameworkPath)) {
300+ throw TaskResult .failure ('Transitive dependency $transitiveDependencyFrameworkPath unexpectedly links on Flutter' );
301+ }
287302
288303 checkFileExists (path.join (
289304 outputPath,
@@ -407,6 +422,18 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
407422 mode,
408423 'package_info.xcframework' ,
409424 ));
425+
426+ checkDirectoryExists (path.join (
427+ cocoapodsOutputPath,
428+ mode,
429+ 'connectivity.xcframework' ,
430+ ));
431+
432+ checkDirectoryExists (path.join (
433+ cocoapodsOutputPath,
434+ mode,
435+ 'Reachability.xcframework' ,
436+ ));
410437 }
411438
412439 if (File (path.join (
@@ -443,3 +470,13 @@ Future<String> _dylibSymbols(String pathToDylib) {
443470 'arm64' ,
444471 ]);
445472}
473+
474+ Future <bool > _linksOnFlutter (String pathToBinary) async {
475+ final String loadCommands = await eval ('otool' , < String > [
476+ '-l' ,
477+ '-arch' ,
478+ 'arm64' ,
479+ pathToBinary,
480+ ]);
481+ return loadCommands.contains ('Flutter.framework' );
482+ }
0 commit comments