在我错过了颤振应用程序后,有啥办法可以回到我的旧 Xcode

Posted

技术标签:

【中文标题】在我错过了颤振应用程序后,有啥办法可以回到我的旧 Xcode【英文标题】:Is there way I could go back to my old Xcode after I missed up the flutter app在我错过了颤振应用程序后,有什么办法可以回到我的旧 Xcode 【发布时间】:2019-09-01 10:11:31 【问题描述】:

我弄乱了我的 Xcode for ios flutter。它要求至少部署 iOS 10.0 摄像头。我有 8.0 但我按下了黄色产量的修复然后它改变了给我所有这些错误的代码。

我尝试复制和粘贴我的备份 Xcode,但没有成功。 Pods/Development Pods/camera/open311_s/ios/.symlinks/camera/iOS/classes/Cameraplugin.m我错过了Xcode里面的这个类。

Xcode 的输出: ↳

 /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:651:45: warning: unused variable
    'discoverySession' [-Wunused-variable]
              AVCaptureDeviceDiscoverySession * discoverySession =
              [AVCaptureDeviceDiscoverySession
                                                ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:662:40: warning: unused variable
    'devices' [-Wunused-variable]
              NSArray<AVCaptureDevice *> * devices = discoverySession.devices;
                                           ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:667:51: error: use of undeclared
    identifier 'devices'
            [[NSMutableArray alloc] initWithCapacity: devices.count];
                                                      ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:668:7: warning: collection expression
    type 'AVCaptureDevice *' may not respond to
    'countByEnumeratingWithState:objects:count:'
          for (AVCaptureDevice *device in device) 
          ^                               ~~~~~~
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:693:19: warning: unused variable 'cam'
    [-Wunused-variable]
              FLTCam *cam = [[FLTCam alloc] initWithCameraName:cameraName
                      ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:706:54: error: use of undeclared
    identifier 'cam'
          int64_t textureId = [_registry registerTexture:cam];
                                                         ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:707:17: error: use of undeclared
    identifier 'cam'
          _camera = cam;
                    ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:708:7: error: use of undeclared
    identifier 'cam'
          cam.onFrameAvailable = ^
          ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:716:38: error: use of undeclared
    identifier 'cam'
          [eventChannel setStreamHandler:cam];
                                         ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:717:7: error: use of undeclared
    identifier 'cam'
          cam.eventChannel = eventChannel;
          ^
    /Users/zuhairhallak/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/camer
    a-0.4.3+2/ios/Classes/CameraPlugin.m:725:8: error: use of undeclared
    identifier 'cam'
          [cam start];
           ^
    4 warnings and 7 errors generated.

我能够正常运行该应用程序,但现在我无法运行它。如何修复 Flutter 应用的 Xcode。

【问题讨论】:

你试过flutter clean 和手册pod install 吗?这可能会解决您的问题,我认为这根本不是 Xcode 问题。还要检查您的签名配置。 我尝试手动进行 pod install 并没有成功。 非常感谢。我找到了原因。 【参考方案1】:

解决方案:

我弄乱了flutter使用其依赖项提供的相机插件类。您可以在 pubspec.yaml 中找到它。我已经删除了相机的依赖,并且应用程序能够运行。那应该可以解决问题。复制flutter插件中的cameraPlugin.m,把乱码删掉再放新的。

https://github.com/flutter/plugins/blob/master/packages/camera/ios/Classes/CameraPlugin.m#L25

【讨论】:

以上是关于在我错过了颤振应用程序后,有啥办法可以回到我的旧 Xcode的主要内容,如果未能解决你的问题,请参考以下文章

如何降级颤振版本

有啥方法可以参考 terraform 中的旧计划吗?

在构建发布 apk 后,我的颤振应用程序没有从 http 获取数据 [重复]

使用颤振音频查询后没有在我的应用程序中获取歌曲文件

有啥办法可以抓取/抓取谷歌搜索的“关于”部分?

你如何在颤振飞镖中渲染脚本标签