首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >M1上的颤振: GoogleMapsBase & Flutter.h从windows迁移到mac后没有发现错误

M1上的颤振: GoogleMapsBase & Flutter.h从windows迁移到mac后没有发现错误
EN

Stack Overflow用户
提问于 2021-10-17 21:39:49
回答 1查看 1.3K关注 0票数 5

我已经在我的windows机器上开发了一个颤振应用程序已经有一段时间了,最近我换了一个带有M1芯片的machine。该应用程序使用谷歌地图,但当我试图在iOS设备上运行它时,我会得到以下错误:

代码语言:javascript
复制
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Xcode build done.                                           72.1s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:1BBC3B77-3A9D-4F09-892A-34C7059C2430, OS:15.0, name:iPad (9th generation) }
    { platform:iOS Simulator, id:BD58EEBD-CC57-418D-B33A-B381EB89E4BE, OS:15.0, name:iPad Air (4th generation) }
    { platform:iOS Simulator, id:01C2C865-7ED0-4B1E-B391-6546DE9FA12B, OS:15.0, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:C0F1BFE8-AC98-487F-8AD2-7A7821D0B1BF, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
    { platform:iOS Simulator, id:A9E3236E-DC77-44FD-A18E-8F0326A8D1B1, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
    { platform:iOS Simulator, id:FC86621E-900F-4D94-B709-592D19CCF5C1, OS:15.0, name:iPad mini (6th generation) }
    { platform:iOS Simulator, id:DF9C52D5-29AE-4048-9EC4-D801ABED90AF, OS:15.0, name:iPhone 8 }
    { platform:iOS Simulator, id:905D86FA-A373-4DC5-8761-9F20D9573F7E, OS:15.0, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:FF07BF67-7EB0-4050-98F5-90937B55C083, OS:15.0, name:iPhone 11 }
    { platform:iOS Simulator, id:1ADD94F5-AFA9-489A-933B-7A01C29A1F80, OS:15.0, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:F5120FD7-77DE-4BE7-AE09-075A7D08DE80, OS:15.0, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:3198F3B5-25EC-41F9-8A0E-801F17325095, OS:15.0, name:iPhone 12 }
    { platform:iOS Simulator, id:5BABC83A-DB25-4040-AB2E-65DFC204D8E2, OS:15.0, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:63451408-2F20-4B65-8E05-570CAA3AAA97, OS:15.0, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:54E2E527-C85D-47F5-ADDE-BA4CF861BE9A, OS:15.0, name:iPhone 12 mini }
    { platform:iOS Simulator, id:ADD48A2B-3DF4-432E-8561-D566DB2E6FB4, OS:15.0, name:iPhone 13 }
    { platform:iOS Simulator, id:91162948-B850-494D-A496-E73DBCBC89B4, OS:15.0, name:iPhone 13 Pro }
    { platform:iOS Simulator, id:9EA1FC3C-1D81-4B6A-8E03-16D634FD64A7, OS:15.0, name:iPhone 13 Pro Max }
    { platform:iOS Simulator, id:01F0486F-D6B3-4BFF-88AD-5D151293F6A9, OS:15.0, name:iPhone 13 mini }
    { platform:iOS Simulator, id:BA8A8DF2-519A-4AD1-BED3-F4BCC0DAD591, OS:15.0, name:iPhone SE (2nd generation) }
    { platform:iOS Simulator, id:7322D286-C468-4FE7-9B82-929CB072CA59, OS:15.0, name:iPod touch (7th generation) }
    { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008103-001148C13679001E }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    ** BUILD FAILED **
Xcode's output:
↳
    ld: building for iOS Simulator, but linking in object file built for iOS, file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-BAB43F53538FCAAA1B752783.sh'
    note: Removed stale file '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PromisesObjC.build/Script-023FA270521F1C5E3ED8F5839885EEA7.sh'
    note: Removed stale file '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Products/Debug-iphonesimulator/google_maps_flutter/google_maps_flutter.framework'
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'leveldb-library' from project 'Pods')
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FMDB' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
Exited (sigterm)

这个错误是否意味着我安装的谷歌地图与我的M1芯片不兼容?如果是这样的话,我该怎么绕过它呢?

Update:在尝试了下面添加的链接中提出的解决方案之后,我得到了一个关于googlemaps.h的错误,这也是我在过去得到的。这是日志:

代码语言:javascript
复制
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Xcode build done.                                           11.3s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:1BBC3B77-3A9D-4F09-892A-34C7059C2430, OS:15.0, name:iPad (9th generation) }
    { platform:iOS Simulator, id:BD58EEBD-CC57-418D-B33A-B381EB89E4BE, OS:15.0, name:iPad Air (4th generation) }
    { platform:iOS Simulator, id:01C2C865-7ED0-4B1E-B391-6546DE9FA12B, OS:15.0, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:C0F1BFE8-AC98-487F-8AD2-7A7821D0B1BF, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
    { platform:iOS Simulator, id:A9E3236E-DC77-44FD-A18E-8F0326A8D1B1, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
    { platform:iOS Simulator, id:FC86621E-900F-4D94-B709-592D19CCF5C1, OS:15.0, name:iPad mini (6th generation) }
    { platform:iOS Simulator, id:DF9C52D5-29AE-4048-9EC4-D801ABED90AF, OS:15.0, name:iPhone 8 }
    { platform:iOS Simulator, id:905D86FA-A373-4DC5-8761-9F20D9573F7E, OS:15.0, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:FF07BF67-7EB0-4050-98F5-90937B55C083, OS:15.0, name:iPhone 11 }
    { platform:iOS Simulator, id:1ADD94F5-AFA9-489A-933B-7A01C29A1F80, OS:15.0, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:F5120FD7-77DE-4BE7-AE09-075A7D08DE80, OS:15.0, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:3198F3B5-25EC-41F9-8A0E-801F17325095, OS:15.0, name:iPhone 12 }
    { platform:iOS Simulator, id:5BABC83A-DB25-4040-AB2E-65DFC204D8E2, OS:15.0, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:63451408-2F20-4B65-8E05-570CAA3AAA97, OS:15.0, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:54E2E527-C85D-47F5-ADDE-BA4CF861BE9A, OS:15.0, name:iPhone 12 mini }
    { platform:iOS Simulator, id:ADD48A2B-3DF4-432E-8561-D566DB2E6FB4, OS:15.0, name:iPhone 13 }
    { platform:iOS Simulator, id:91162948-B850-494D-A496-E73DBCBC89B4, OS:15.0, name:iPhone 13 Pro }
    { platform:iOS Simulator, id:9EA1FC3C-1D81-4B6A-8E03-16D634FD64A7, OS:15.0, name:iPhone 13 Pro Max }
    { platform:iOS Simulator, id:01F0486F-D6B3-4BFF-88AD-5D151293F6A9, OS:15.0, name:iPhone 13 mini }
    { platform:iOS Simulator, id:BA8A8DF2-519A-4AD1-BED3-F4BCC0DAD591, OS:15.0, name:iPhone SE (2nd generation) }
    { platform:iOS Simulator, id:7322D286-C468-4FE7-9B82-929CB072CA59, OS:15.0, name:iPod touch (7th generation) }
    { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008103-001148C13679001E }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    ** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/steliospapamichail/development/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.11/ios/Classes/JsonConversions.m:5:
/Users/steliospapamichail/development/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.11/ios/Classes/JsonConversions.h:6:9: fatal error: 'GoogleMaps/GoogleMaps.h' file not found
    #import <GoogleMaps/GoogleMaps.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PromisesObjC.build/Script-E551D73C516C8F1E426DC570FE93233F.sh'
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FBLPromises.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FMDB.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FirebaseAuth.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FirebaseCore.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FirebaseCoreDiagnostics.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/FirebaseDatabase.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/GTMSessionFetcher.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/GoogleDataTransport.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/GoogleUtilities.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/leveldb.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/nanopb.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/path_provider.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/share_plus.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/shared_preferences.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/sqflite.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/url_launcher.framework' is located outside of the allowed root paths.
    warning: Stale file '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/build/ios/Debug-iphonesimulator/Runner.app/GoogleMaps.bundle' is located outside of the allowed root paths.
    note: Removed stale file '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Products/Debug-iphonesimulator/google_maps_flutter/google_maps_flutter.framework'
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FMDB' from project 'Pods')
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'leveldb-library' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
Exited (sigterm)

更新2:我意识到VSCode的终端没有在rosetta中运行,所以当我试图进行pod更新或pod安装时,我遇到了一大堆错误。使用rosetta打开一个单独的终端并运行这些命令,通过执行google_maps_flutter更新修复谷歌地图错误。剩下的唯一问题是Xcode项目找不到flutter.framework目录,我在“框架、库和嵌入式内容”下也找不到它,这会导致xcode的构建失败。这是堆栈:

代码语言:javascript
复制
Xcode's output:
↳
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:9:
    note: in file included from /Users/steliospapamichail/Dropbox/Freelancing/Flutter
    Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/GeneratedPluginRegistrant.h:10:9:
    error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    1 error generated.
    <unknown>:0: error: failed to emit precompiled header
    '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Intermediates.noindex
    /PrecompiledHeaders/Runner-Bridging-Header-swift_MU0M9NUV63KT-clang_15TXGWK3O5BI2.pch' for bridging header
    '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h'
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:9:
    note: in file included from /Users/steliospapamichail/Dropbox/Freelancing/Flutter
    Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    2 errors generated.
    error: generate-pch command failed with exit code 1 (use -v to see invocation)
    error: generate-pch command failed with exit code 1 (use -v to see invocation)
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:9:
    note: in file included from /Users/steliospapamichail/Dropbox/Freelancing/Flutter
    Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/GeneratedPluginRegistrant.h:10:9:
    error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    1 error generated.
    <unknown>:0: error: failed to emit precompiled header
    '/Users/steliospapamichail/Library/Developer/Xcode/DerivedData/Runner-czjbhkfeqllyfpfkhbtzrnpkcvgk/Build/Intermediates.noindex
    /PrecompiledHeaders/Runner-Bridging-Header-swift_20I7K2PWHDC7X-clang_2NM9DJHUIVDYE.pch' for bridging header
    '/Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h'
    /Users/steliospapamichail/Dropbox/Freelancing/Flutter Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:9:
    note: in file included from /Users/steliospapamichail/Dropbox/Freelancing/Flutter
    Projects/JustPlay/just_play/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    2 errors generated.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-21 13:22:22

在这个问题上花了几天时间之后,我“解决了”了这个问题,但不是以我引以为豪的方式解决的,但它可能对面临同样问题的人有用。

是什么引起的

我最初是在Windows机器上开始开发的,然后转到M1 machine上,以便在iOS模拟器上测试该应用程序。我被提示安装可可豆荚,然后做一个吊舱安装。可悲的是,当我运行吊舱安装时,我遇到了一个关于不兼容的吊舱版本的错误,我惊慌失措导致我取消了这个过程。然后,我开始尝试我在StackOverflow上找到的不同的解决方案,但这只会使事情变得更糟。这些变化只是让我忘记了最初的问题是什么,因此,我无法从混乱中恢复过来。在应用了下面概述的步骤之后,我发现最初的罪魁祸首是在pod install one失败后没有运行一个简单的pod命令,出现了下面提到的错误。

解决方案

以下是我纠正这个问题所遵循的步骤:

  1. 创建了一个新的颤振项目
  2. 复制了android & lib文件夹(因为它们没有引起任何问题),也复制了pubspec.yml和.lock文件。然后,为了支持谷歌地图,我把与防火墙相关的文件与SwiftDelegate一起复制到了ios目录中,因为我做了一些修改,以支持谷歌地图。一旦完成,我所要做的就是运行pod install,并且不可避免地会出现荚依赖版本问题。我只需运行pod update,就可以修复
  3. 的所有问题。
  4. 的最后一步是将arm64体系结构从()、Runner目标和Pods目标中排除在外,并将最低ios版本更改为9.

就是这样,一旦这些事情都做好了,一切都很顺利。

摘要

最后,如果你喜欢我,在你的第一次macOS体验中遇到类似的问题,不要惊慌失措,更新你的吊舱,然后你就会没事了。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69608804

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档