当我尝试将beta firestore添加到我的Google云平台项目时,我收到以下消息.
无法为此项目启用Firestore
目前,在已使用Cloud Datastore或App Engine的项目中无法启用Firestore
这会永远持续下去吗?
我想我想用firestore替换一些但不是全部的数据存储区来获得实时更新.
也许firestore在其后端使用数据存储和appengine?
我应该使用两个GCP项目来解决这个问题吗?
谢谢,内森
google-app-engine firebase google-cloud-datastore google-cloud-platform google-cloud-firestore
更新:聚合物文档现已更新,以反映下面的答案
我正在做一个聚合物1.0应用程序.
我正在尝试在屏幕的一部分水平布局一些纸质工具栏.
看来我可以使用iron-flex-layout的@apply( - layout-horizontal)来处理某些元素而不是其他元素.
我在下面放了一个小测试来显示最新情况.
有趣的是,如果我将--layout-horizontal风格的内容复制到chrome dev工具中的标签中,它就可以工作.如果我只是将--layout-horizontal的内容复制到新样式中,它也可以工作.
这是最近发生的例子.
第一个div是0.5到1.0迁移指南中的示例.
第二个div是示例,而是尝试布局一个部分而不是跨度.
第三行是我明确复制并应用--layout-horizontal风格的地方.

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
<dom-module id="layout-test">
<style>
/* Example from migration guide */
.header {
@apply(--layout-horizontal --layout-center);
}
/* A hack that makes it work */
.hack {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
}
</style>
<template>
<!-- Working example from migration guide -->
<div class="header">
<img src="https://www.polymer-project.org/images/logos/lockup.svg">
<span class="name">name</span>
</div>
<!-- This example does not work …Run Code Online (Sandbox Code Playgroud) 我做了很多谷歌搜索,但是其他人的解决方案对我来说却行不通。
我的目标是在报警通道上按需播放声音。
(因此,音量是通过警报音量设置来调整的)
从这个线程,我建立以下代码
mediaPlayerScan = MediaPlayer.create(getContext(), R.raw.scan_beep);
if (Build.VERSION.SDK_INT >= 21) {
mediaPlayerScan.setAudioAttributes(new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build());
} else {
mediaPlayerScan.setAudioStreamType(AudioManager.STREAM_ALARM);
}
Run Code Online (Sandbox Code Playgroud)
它仍然在音乐频道上播放。(在音乐设置中调整IE音量不会发出警报)
我的直觉是我缺少权限之类的东西,但是我没有找到这样的权限。
我正在Google Pixel 1上进行测试
谢谢,
内森
编辑:
感谢@ jeffery-blattman,以下代码对我有用
mediaPlayerScan = new MediaPlayer();
try {
mediaPlayerScan.setDataSource(getContext(),
Uri.parse(getString(R.string.res_path) + R.raw.scan_beep));
if (Build.VERSION.SDK_INT >= 21) {
mediaPlayerScan.setAudioAttributes(new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build());
} else {
mediaPlayerScan.setAudioStreamType(AudioManager.STREAM_ALARM);
}
mediaPlayerScan.prepare();
} catch (IOException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud) I am trying to use apache beam's google datastore api to ReadFromDatastore
p = beam.Pipeline(options=options)
(p
| 'Read from Datastore' >> ReadFromDatastore(gcloud_options.project, query)
| 'reformat' >> beam.Map(reformat)
| 'Write To Datastore' >> WriteToDatastore(gcloud_options.project))
Run Code Online (Sandbox Code Playgroud)
The object that gets passed to my reformat function is type
google.cloud.proto.datastore.v1.entity_pb2.Entity
It is in protobuf format which is hard to modify or read.
I think I can convert a entity_pb2.Entity to a dict with
entity= dict(google.cloud.datastore.helpers._property_tuples(entity_pb))
Run Code Online (Sandbox Code Playgroud)
But for some reason trying to import the following two …
python protocol-buffers google-cloud-datastore google-cloud-dataflow apache-beam