颤振:“致命错误:找不到模块'位置'”Xcode找不到模块

Posted

技术标签:

【中文标题】颤振:“致命错误:找不到模块\'位置\'”Xcode找不到模块【英文标题】:flutter: "fatal error: module 'location' not found" Xcode cannot found modules颤振:“致命错误:找不到模块'位置'”Xcode找不到模块 【发布时间】:2022-01-16 07:36:28 【问题描述】:

我尝试使用地理定位器获取当前位置,但 Xcode(在 M1 Mac/arm64 上)无法检测到该模块。经过一番研究,我简单地更改了插件并集成了推荐的酒吧定位器。然而,在那之后,同样的错误仍然发生。也没有找到这个模块。

↳
    objc[7998]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x1eab43130) and
    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1080f02c8). One of the two will be used. Which one is undefined.
    objc[7998]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x1eab43180) and
    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1080f0318). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/campermike/Documents/projects/cnow/ios/Runner/GeneratedPluginRegistrant.m:18:9: fatal error: module 'location' not found
    @import location;
     ~~~~~~~^~~~~~~~

【问题讨论】:

【参考方案1】:

我最近遇到了类似的错误,所以如果您想节省时间,请按照我的方法。 你需要crate new project with same bundle id in your m1 Mac machine and just replace your codes & ios & android mandatory files. Because all errors are architecture related.

但在此之前,请先做以下事情:

1.删除发布缓存。 2.Flutter 清洁 3.删除xcode派生数据。

【讨论】:

以上是关于颤振:“致命错误:找不到模块'位置'”Xcode找不到模块的主要内容,如果未能解决你的问题,请参考以下文章

颤振:如何创建一个新项目

颤振:致命错误:找不到模块“firebase_analytics”

构建到 IOS 的颤振时找不到 BoringSSL-GRPC.modulemap

如何从 Xcode 打开现有的颤振项目?

颤振和 Xcode 构建问题

如何在 Xcode 中打开颤振插件?