Swift没有在Build Options下添加Ob-C桥接头文件的选项(Swift no option to add an Ob-C bridging header file under Build Options)
我使用Cocoapods为我的Swift项目添加了一些Objective C文件。 我使用File-> New-> File IOS Source Header File创建了一个Bridging-Header.h文件。 它在项目中。 请参阅左侧带有项目文件的屏幕截图。 我现在需要将该文件添加到Project Build Settings - > Swift Compiler - Code Generation。
问题是(参见屏幕截图)添加Bridge文件的选项不存在! ??? 我无法在网络,cocoapods或苹果的任何地方找到这样的问题的参考。 任何人都可以建议一种方法来获得添加桥接文件的选项出现在构建设置中
I have added some Objective C files to my Swift project using Cocoapods. I created a Bridging-Header.h file using File->New->File IOS Source Header File. It is in the project. See screen shot with project files on left. I now need to add that file to the Project Build Settings -> Swift Compiler - Code Generation.
The problem is (see screen shot) that the option to add the Bridge file does not exist!!! ??? I cannot find a reference to a problem like this anywhere on the web, cocoapods or apple. Can anyone suggest a way to get the option to add the bridging file appear in the Build Settings
原文:https://stackoverflow.com/questions/30405358
最满意答案
看起来您在本地计算机上运行该代码并尝试连接到Google Compute Engine VM; 默认情况下,GCE具有严格的防火墙设置,以避免将外部IP地址暴露给任意入站连接。 如果您使用的是默认值,那么您的Hadoop集群应该位于“默认”GCE网络上。 您需要按照添加防火墙说明来允许端口8020上的传入TCP连接以及其他Hadoop端口上的连接以及本地IP地址以实现此操作。 它看起来像这样:
gcloud compute firewall-rules create allow-http \ --description "Inbound HDFS." \ --allow tcp:8020 \ --format json \ --source-ranges your.ip.address.here/32
请注意,您确实希望避免打开
0.0.0.0/0
源范围,因为Hadoop没有对这些传入请求进行身份验证或授权。 您需要尽可能地将其限制为仅计划拨入的入站IP地址。您可能还需要打开其他几个端口,具体取决于您使用哪种功能连接到Hadoop。更一般的建议是,只要有可能,您应该尝试在Hadoop集群本身上运行代码; 在这种情况下,您将使用主主机名本身作为HDFS权限而不是外部IP:
hdfs://<master hostname>/foo/bar
这样,您可以将端口暴露限制在仅仅SSH端口22,SSH端口守护程序正确地控制传入流量,然后您的代码不必担心哪些端口是打开的,甚至不必担心处理IP地址所有。
It looks like you're running that code on your local machine and trying to connect to the Google Compute Engine VM; by default, GCE has strict firewall settings to avoid exposing your external IP addresses to arbitrary inbound connections. If you're using defaults then your Hadoop cluster should be on the "default" GCE network. You'll need to follow the adding a firewall instructions to allow incoming TCP connections on port 8020 and possible on other Hadoop ports as well from your local IP address for this to work. It'll look something like this:
gcloud compute firewall-rules create allow-http \ --description "Inbound HDFS." \ --allow tcp:8020 \ --format json \ --source-ranges your.ip.address.here/32
Note that you really want to avoid opening a
0.0.0.0/0
source-range since Hadoop isn't doing authentication or authorization on those incoming requests. You'll want to restrict it as much as possible to only the inbound IP addresses from which you plan to dial in. You may need to open up a couple other ports as well depending on what functionality you use connecting to Hadoop.The more general recommendation is that wherever possible, you should try to run your code on the Hadoop cluster itself; in that case, you'll use the master hostname itself as the HDFS authority rather than external IP:
hdfs://<master hostname>/foo/bar
That way, you can limit the port exposure to just the SSH port 22, where incoming traffic is properly gated by the SSH daemon, and then your code doesn't have to worry about what ports are open or even about dealing with IP addresses at all.
相关问答
更多-
如何从java中删除Google Cloud Platform中的存储桶?(How can I delete a bucket in Google Cloud Platform from java?)[2021-09-20]
首先,桶必须是空的。 然后你可以这样做: storage.buckets()。删除(Properties.bucketId).execute() 其中存储是com.google.api.services.storage 我希望它有所帮助! :) First of all the bucket must be empty. Then you can do: storage.buckets().delete(Properties.bucketId).execute() where storage is com. ... -
您可以通过上传带有斜杠的零大小对象来模拟文件夹。 正如问题评论中所述,Google云端存储不是文件系统,并且模拟文件夹具有严重的局限性。 You can emulate a folder by uploading a zero-sized object with a trailing slash. As noted in the question comments, Google Cloud Storage is not a filesystem and emulating folders has seri ...
-
如果他们说您不能将GCP包用于营销活动,我想您不能。 但您可以创建一个直接的SendGrid帐户,并使用代码级集成进行连接。 无论哪种方式,你都应该向GCP支持这个限制,让他们知道你喜欢这个功能。 如果这是一个故意的限制,那么添加它的“理货”对他们的产品团队来说非常重要。 If they said you can't use the GCP package for Marketing Campaigns, I guess you can't. But you can create a direct Send ...
-
Google云端存储(Google Cloud Storage)[2023-05-03]
如果您需要核心功能并计划在App Engine上运行应用程序,请使用云存储客户端库 。 对于大多数基本功能,它更容易使用(截至本回答时)。 如果您计划在App Engine实例之外运行代码和/或需要Google API客户端库不支持的功能(例如,可恢复上传),请使用Google Cloud Java库 。 If you need core features and plan to run your app on App Engine, use Cloud Storage Client Library. It ... -
Google Cloud Platform以编程方式通过API创建用户帐户(Google Cloud Platform programmatically create user account via API)[2022-03-18]
更新IAM策略确实是使用API在“纯GCP”级别上授予访问权限的唯一方法。 但是,您可以在项目中为Google Group(或少数,如果您需要不同的访问级别)中的角色,然后使用GSuite Admin SDK管理该组。 Updating the IAM policy is indeed the only way to use an API to grant access on a "pure GCP" level. However, you can give a role in a project to a ... -
用于对API进行身份验证的 Google Vision API文档清楚地提供了如何获取凭据的分步指南,该页面的最后一部分介绍了Authenticating with Application Default Credentials : 应用程序向Google Cloud Platform API服务进行身份验证的最简单方法是使用应用程序默认凭据(ADC)。 使用ADC的服务首先在GOOGLE_APPLICATION_CREDENTIALS环境变量中搜索凭据。 除非您特别希望让ADC使用其他凭据(例如,用户凭据 ...
-
看起来您在本地计算机上运行该代码并尝试连接到Google Compute Engine VM; 默认情况下,GCE具有严格的防火墙设置,以避免将外部IP地址暴露给任意入站连接。 如果您使用的是默认值,那么您的Hadoop集群应该位于“默认”GCE网络上。 您需要按照添加防火墙说明来允许端口8020上的传入TCP连接以及其他Hadoop端口上的连接以及本地IP地址以实现此操作。 它看起来像这样: gcloud compute firewall-rules create allow-http \ --d ...
-
事实证明我必须修改防火墙规则以允许来自ip的tcp / http我正在运行distcp。 检查GCP计算实例上的网络防火墙。 It turns out I had to modify firewall rules to allow tcp/http from the ip I was running distcp on. Check the networking firewalls on GCP compute instances.
-
由于没有人回复,我深入研究了一些文档,发现这个页面描述了如何从应用程序外部(curl +浏览器)获取刷新令牌,并将其插入代码中以调用目录API: const google = require('googleapis'); const admin = google.admin('directory_v1'); const OAuth2 = google.auth.OAuth2; var oauth2Client = new OAuth2( 'client_id', 'client_secre ...
-
带有Google Cloud Endpoints的.api文件 - 如何自定义(.api file with Google Cloud Endpoints - how do I customise)[2023-12-03]
您可以创建自定义端点。 您只需添加文档中所述的注释。 我很难做到这一点,我放心你必须遵循一些规则,即: 您的api和方法名称不能使用“_”,因此@Api(name =“my_api”)是错误的,而@Api(name =“myApi”)是正确的。 你的api方法不能返回简单类型,所以返回一个String是错误的,但返回MyString是对的。 您的方法也可以返回void 。 自定义端点的示例应如下所示: import com.google.api.server.spi.config.Api; import c ...