问题描述
我在一个客户购买的项目中工作。该项目是Fluxstore。用Flutter构建的电子商务。
我可以在Android中运行该项目(模拟器和device =)。但是iOS无法运行。我收到以下错误消息:
Launching lib/main.dart on iPhone 11 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 138,6s
Failed to build iOS app
Could not build the application for the simulator.
Error launching application on iPhone 11.
Error output from Xcode build:
↳
** BUILD Failed **
Xcode's output:
↳
/Users/user./projects/project/ios/Runner/AppDelegate.swift:3:8: error: no such module 'GoogleMaps'
import GoogleMaps
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
我在Internet上查找了针对此问题的解决方案,但没有任何效果。有人可以帮我吗?
解决方法
flutter pub get
cd ios
pod install
pod update
,
您是否在pubspec.yaml中签入了该项目是否仍使用google_maps?因为如果没有,那么您应该删除AppDelegate.swift
中的两行。 (导入google_maps和GMSServices.provideAPIKey
。
这应该可以解决问题。
,删除所有 pod 文件。运行flutter clean
。然后转到 iOS 文件夹并运行 pod init
。它创建了一个 pod 文件。在 pod 'GoogleMaps'
target 'Runner' do
此行
我分享我的 pod 文件代码
# Uncomment the next line to define a global platform for your project
# platform :ios,'9.0'
pod 'Firebase/Analytics'
pod 'GoogleMaps'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end