这是我第一次完成归档我的应用程序的过程,我的问题是,当我构建项目时,它构建得很好,它在模拟器上比物理 iPad 上都运行得很好,但是当我选择Archive它时,它会失败并显示错误消息Command PhaseScriptExecution failed with a nonzero exit code 31merror: Unable to read GoogleService-Info.plist at path。在 SO 上的其他帖子之后,我确保存在 in Build Phases/Copy Bundle Resources GoogleService-Info.plist。我还检查了GoogleService-Info.plist是否正确选择了Target Membership。我试图删除,将其扔进垃圾箱,然后通过拖放将其重新添加到项目中。我重新启动了 Xcode,但没有解决它。关于我还应该看什么的任何想法?它可能与我的开发人员证书有关吗?一如既往,非常感谢。
更新:
我尝试卸载 Pod 并重新安装它们,但没有任何更改。我再次GoogleService-Info.plist从 Firebase下载了,但这也没有什么区别。
更新 2:
我删除了 firebase 应用程序并重新创建了一个。重新下载了GoogleService-Info.plist它,它在 iPad 和模拟器上都可以正常工作。
但仍然存档失败无法读取GoogleService-Info.plist..
我实际上是在为 iOS 9.3 及更高版本进行部署……这与它有关系吗?
我正在关注《变形金刚》和 colab 项目的指南https://colab.research.google.com/drive/1XBP0Zh8K4g_n0A2p1UlGFf3dij0EX_Kt
但是当我用该行运行单元格时,multi_head = build_model()我收到错误。
这是控制台的输出:
() 中的 NameError Traceback(最近一次调用最后一次)----> 1 multi_head = build_model()
(x) 中的 5 帧 40 self.dropout = Dropout(attn_dropout) 41 def call (self, q, k, v, mask): ---> 42 attn = Lambda(lambda x:K.batch_dot(x[0]) ,x[1],axes=[2,2])/self.temper)([q, k]) 43 如果 mask 不是 None: 44 mmask = Lambda(lambda x:(-1e+10)*(1 -x))(掩码)
NameError:名称“K”未定义
它只是在错误所指的模型架构代码之后运行。你能看出K应该在哪里定义它吗?
import random, os, sys
import numpy as np
from tensorflow.keras.models import *
from tensorflow.keras.layers import *
from tensorflow.keras.callbacks import *
from tensorflow.keras.initializers import …Run Code Online (Sandbox Code Playgroud) 我对深度学习和 python 非常陌生,我正在尝试在https://github.com/Nagakiran1/Extending-Google-BERT-as-Question-and-Answering-model-and-Chatbot重新创建该项目
正如我所看到的,在该项目中有一个名为Bert_QuestionAnswer.ipynb和 with 的文件data.txt,这是我与原始 Bert 存储库看到的唯一区别,我只是将其加载到我的谷歌驱动器中并将其作为笔记本打开以查看它的使用情况。当我运行第一部分面团时,出现错误ModuleNotFoundError: No module named 'modeling'。它属于哪个图书馆?对于某人来说,这就是问题所在:
看起来它正在尝试从 github 存储库源而不是 pip 包导入。
如果您在包含 BERT github 存储库的目录中运行它,请尝试在其他地方运行它。
一如既往,非常感谢您的帮助。这是引发错误的文件的代码:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from IPython.core.debugger import set_trace
import collections
import json
import math
import os
import random
import modeling
import optimization
import tokenization
import six
import os
import tensorflow as tf
import logging
logging.getLogger('tensorflow').disabled = True
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import warnings
warnings.filterwarnings("ignore") …Run Code Online (Sandbox Code Playgroud) 使用以下代码从 url 下载图像时,我的 get 请求被 CORS 策略阻止:
await get(product.imageUrl).then((img) async {
print('image downloaded');
var dwnldProd = product;
dwnldProd.productImage = img.bodyBytes;
await _productRepository.saveProduct(dwnldProd);
}).catchError((e) {
print('downloading product image error: $e');
});
Run Code Online (Sandbox Code Playgroud)
正如No 'Access-Control-Allow-Origin' header is present on the requested resource.所说我的请求缺少标题,所以我将它们添加为:
await get(product.imageUrl, headers: <String,String>{
'Access-Control-Allow-Origin': '*', // Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
// 'Access-Control-Allow-Origin':'http://localhost:5000/', // Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
"Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, …Run Code Online (Sandbox Code Playgroud) 我正在将 Swift 应用程序移植到 Flutter,并且有各种用于时间输入的文本字段,因此为了让用户只能输入有效时间,我使用 Bloc 来验证它。基本上,在每次输入时,我都会在文本字段的 onChanged 回调中使用字符串和文本字段的 TextEditingController发送一个ValidateText()事件。OpeningTimesBloc
onChanged: (String value) {
print('textfield 1 onChanged: called');
BlocProvider.of(context)
.add(ValidatedText(text: value, controller: monMorOp));
},
Run Code Online (Sandbox Code Playgroud)
我OpeningTimesBloc进行验证并使用经过验证的字符串生成一个状态。在OpeningTimesScreens中BlocListener,我获取并使用新值。现在我的麻烦是我有 28 个文本字段,因为我有TextEditingController monMorOp每个工作日的早上和下午的开放和关闭时间(例如:周一早上开放)和下午的关闭时间。
我是否需要 28 个 TextEditingController 并对以下中的每个控制器进行状态检查BlocListener:
if (state is ValidatedTextMonMorOp) {
setState(() {
monMorOp.controller.text = state.text;
});
}
Run Code Online (Sandbox Code Playgroud)
或者我怎样才能只传递一个引用,它将引导焦点所在的文本字段?也许是这样的?
if (state is ValidatedText) {
setState(() {
state.controller.text = state.text;
});
}
Run Code Online (Sandbox Code Playgroud)
一如既往,非常感谢您的时间和帮助。
SyncBloc我在一个MultiBlocProvider(包)中添加了一个新的块flutter_bloc,它创建了所需的所有块,MapScreen并且对于某些块,它还添加了在屏幕本身中呈现数据所需的事件。问题是,虽然位置事件 (for LocationBloc) 是从 MultiBlocProvider 本身正确添加的,但同步事件 (for SyncBloc) 却不是。如果我改为从 的MapScreenMultiBlocListener添加它们
BlocProvider.of<SyncBloc>(context).add(SyncLanguages());
Run Code Online (Sandbox Code Playgroud)
它们按预期工作,因此看起来SyncBloc已正确提供。您能发现我在新版本中做错了什么SyncBloc或为我指出正确的方向吗?一如既往,非常感谢您的时间和帮助。
这是 MultiBlocProvider 中的main():
@override
Widget build(BuildContext context) {
return MaterialApp(
localizationsDelegates: [
const AppLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('en', ''),
const Locale('it', ''),
const Locale('es', ''),
],
localeResolutionCallback:
(Locale locale, Iterable<Locale> supportedLocales) {
for (Locale supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode ||
supportedLocale.countryCode == locale.countryCode) {
return …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,对于网络版本,我使用 package firebase 7.3.0。我首先使用单例实例化 Firebase 应用程序,然后实例化 Messaging(),就像我在我的应用程序中使用的所有其他 Firebase 服务所做的那样:
App firebase = FirebaseWeb.instance.app;
var firebaseMessaging = messaging();
Run Code Online (Sandbox Code Playgroud)
我有subscribeToTopic()方法首先调用getMessagingToken()方法,因为它需要返回的令牌,但getMessagingToken()抛出错误:
PlatformPushNotificationWeb.getMessagingToken() getToken error: FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:5000/firebase-cloud-messaging-push-scope') with script ('http://localhost:5000/firebase-messaging-sw.js'): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration). (messaging/failed-service-worker-registration)
Run Code Online (Sandbox Code Playgroud)
Future<String> getMessagingToken() async {
String token;
await firebaseMessaging.requestPermission().timeout(Duration(seconds: 5)).then((value) {
print('PlatformPushNotificationWeb.getMessagingToken() requestPermission result is $value');
}).catchError((e) …Run Code Online (Sandbox Code Playgroud) 我试图将Date signUpDate通过 http 请求接收到的 MongoDb User 对象中的字段解析为 Flutter DateTime signUpDate,但它总是失败。在我的用户架构中,我有signUpDate: { type: Date, required: false, default: Date.now },. 在我的 Flutterfactory User.fromMongoDB(Map<String, dynamic> map)助手中,我使用signUpDate: DateTime.parse(map['signUpDate']). 当打印http响应signUpDate时"signUpDate":"2021-12-15T11:10:01.521Z"。这只是从 mongo 返回的格式无法被 DateTime 解析器解析还是我错误地解析了它?非常感谢。