下午好,
我正在关注有关 IOS 9.3.5 上的 Ipad 的 Windows 7 教程:
https://medium.com/flutter-community/developing-and-debugging-flutter-apps-for-ios-without-a-mac-8d362a8ec667 我一直在重建 Flutter Tool。(教程的最后一部分)
我下载(从教程的链接)并复制C:\src\flutter\bin
到libimobiledevice、ideviceinstaller和哪些二进制文件中。然后我运行了git apply ios.diff
,这给了我多个错误,有时只是关于 mac.dart,有时更像是这样:
error: patch failed: packages/flutter_tools/lib/src/ios/devices.dart:103
error: packages/flutter_tools/lib/src/ios/devices.dart: patch does not apply
error: patch failed: packages/flutter_tools/lib/src/ios/ios_workflow.dart:26
error: packages/flutter_tools/lib/src/ios/ios_workflow.dart: patch does not apply
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
error: packages/flutter_tools/lib/src/ios/mac.dart: patch does not apply
然后我在这里找到了这个命令:git:patch does not apply
git apply --reject --whitespace=fix mychanges.patch
我得到的是:(不要介意 的内容Future<String>
,这是因为我已经将其更改为应有的内容)
Checking patch packages/flutter_tools/lib/src/ios/mac.dart...
error: while searching for:
Future<String> getAvailableDeviceIDs() async {
try {
final ProcessResult result = await processManager.run(<String>['idevice_id', '-l']);
if (result.exitCode != 0)
throw ToolExit('idevice_id returned an error:\n${result.stderr}');
return result.stdout;
} on ProcessException {
throw ToolExit('Failed to invoke idevice_id. Run flutter doctor.');
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
Applying patch packages/flutter_tools/lib/src/ios/devices.dart with 1 reject...
Rejected hunk #1.
Applying patch packages/flutter_tools/lib/src/ios/ios_workflow.dart with 1 reject...
Rejected hunk #1.
Applying patch packages/flutter_tools/lib/src/ios/mac.dart with 1 reject...
Rejected hunk #1.
此时我在mac.dart文件中手动粘贴了正确的内容(正如您可能在上面的错误中看到的那样),但我仍然不确定一切是否顺利,因为:
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
无论如何,我继续运行命令来重建颤振工具:
bin\cache\dart-sdk\bin\dart --snapshot=.\bin\cache\flutter_tools.snapshot --packages=.\packages\flutter_tools\.packages .\packages\flutter_tools\bin\flutter_tools.dart
最后,输出是这样的:
C:\src\flutter>bin\cache\dart-sdk\bin\dart --snapshot=.\bin\cache\flutter_tools.snapshot --packages=.\packages\flutter_tools\.packages .\
packages\flutter_tools\bin\flutter_tools.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart:20:30: Error: Getter not found: 'iMobileDevice'.
bool get canListDevices => iMobileDevice.isInstalled || (xcode.isInstalledAndMeetsVersionCheck && xcode.isSimctlInstalled);
^^^^^^^^^^^^^
packages/flutter_tools/lib/src/ios/ios_workflow.dart:20:30: Error: The getter 'iMobileDevice' isn't defined for the class 'IOSWorkflow'.
- 'IOSWorkflow' is from 'package:flutter_tools/src/ios/ios_workflow.dart' ('packages/flutter_tools/lib/src/ios/ios_workflow.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'iMobileDevice'.
bool get canListDevices => iMobileDevice.isInstalled || (xcode.isInstalledAndMeetsVersionCheck && xcode.isSimctlInstalled);
^^^^^^^^^^^^^
这个“iMobileDevice”是否与这个 libimobiledevice 相关?我可以运行任何ideviceinstaller.exe
or idevice_id.exe
,所以我想我正确安装了它。
我错过了纠正此错误的重要内容?
非常感谢您的时间:)