【发布时间】:2020-01-26 17:56:59
【问题描述】:
下午好,
我正在学习有关 iOS 9.3.5 上 Ipad 的 Windows 7 教程:
https://medium.com/flutter-community/developing-and-debugging-flutter-apps-for-ios-without-a-mac-8d362a8ec667 我被困在重建 Flutter 工具上。 (教程的最后一部分)
我下载(从教程的链接)并在C:\src\flutter\bin 中复制了 libimobiledevice、ideviceinstaller 和 which 二进制文件。
然后我运行了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 或idevice_id.exe 中的任何一个,所以我想我安装正确。
我遗漏了一些重要的东西来纠正这个错误?
非常感谢您的宝贵时间:)
【问题讨论】:
标签: ios android-studio flutter libimobiledevice