尝试运行时出现此错误。
<svg>
<path d="
M0,60
Q30,60 30,30
A30 30 0 0 1 90,30
Q90,60 120,60
"/>
</svg>
[✓] Flutter(在Mac OS X 10.14.2 18C54上为Channel dev,v1.1.5,区域设置为en-NG)
[✓] Android工具链-为Android设备开发(Android SDK版本28.0.3)
[✓] iOS工具链-为iOS设备开发(Xcode 10.1)
[✓] Android Studio(3.2版)
[✓] IntelliJ IDEA Ultimate Edition(版本2018.1.6)
[✓]已连接的设备(1个可用)
•找不到问题!
答案 0 :(得分:3)
对于具有两个 Google服务plist文件的情况,您可以添加一个新的构建阶段,以将文件复制到编译时的正确位置。
environment="default"
# Regex to extract the scheme name from the Build Configuration
# We have named our Build Configurations as Debug-dev, Debug-prod etc.
# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.
# We are using the $CONFIGURATION variable available in the XCode build environment to extract
# the environment (or flavor)
# For eg.
# If CONFIGURATION="Debug-prod", then environment will get set to "prod".
if [[ $CONFIGURATION =~ -([^-]*)$ ]]; then
environment=${BASH_REMATCH[1]}
fi
echo $environment
# Name and path of the resource we're copying
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
GOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}
# Make sure GoogleService-Info.plist exists
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}"
if [ ! -f $GOOGLESERVICE_INFO_FILE ]
then
echo "No GoogleService-Info.plist found. Please ensure it's in the proper directory."
exit 1
fi
# Get a reference to the destination location for the GoogleService-Info.plist
# This is the default location where Firebase init code expects to find GoogleServices-Info.plist file
PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
echo "Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}"
# Copy over the prod GoogleService-Info.plist for Release builds
cp "${GOOGLESERVICE_INFO_FILE}" "${PLIST_DESTINATION}"
尝试运行该应用程序,它应该很好
答案 1 :(得分:0)
我猜你忘了将something_with(defaultdict(), datainit)
文件添加到ios项目中
请遵循codelab (point 6 and 7 specifically)以获取详细说明。
请记住,将其从GoogleService-Info.plist
或ios/Runner
复制到finder/explorer
文件夹中是不够的。
您需要使用command line
打开ios/Runner.xcworkspace
并将文件添加到项目树 。 Xcode需要知道此文件,以便可以将其复制到应用程序包中。
答案 2 :(得分:0)
如果要同时为iOS和Android开发Flutter应用,则需要在同一Firebase项目中分别注册iOS和Android版本。
配置iOS
要提供的重要值是iOS捆绑包ID,您可以通过以下三个步骤获得它。
在命令行工具中,转到Flutter应用程序的顶级目录。
运行命令open ios / Runner.xcworkspace打开Xcode(转到> ios / Runner.xcworkspace,然后单击右键并选择Flutter,然后单击Xcode中的Open iOS模块)
在Xcode中,单击左窗格中的顶级Runner,以在右窗格中显示“常规”选项卡,如下面的屏幕截图所示。复制捆绑包标识符值。
返回Firebase对话框,将复制的Bundle Identifier粘贴到iOS bundle ID字段中,然后单击Register App。
继续在Firebase中,按照说明下载配置文件GoogleService-Info.plist。
返回到Xcode。请注意,Runner具有一个也称为Runner的子文件夹(如上面的屏幕截图所示)。
将GoogleService-Info.plist文件(您刚刚下载的文件)拖到该Runner子文件夹中。
在Xcode中出现的对话框中,单击“完成”。
返回Firebase控制台。在设置步骤中,单击“下一步”,然后跳过其余步骤并返回Firebase控制台的主页。
您已经完成了针对iOS的Flutter应用的配置!
For More :
Platform-specific Firebase configuration