简体   繁体   English

为Android构建时出现Facebook Unity SDK问题

[英]Facebook Unity SDK issues when building for Android

I am not being able to solve this build-time issue when building for Android. 在为Android进行构建时,我无法解决此构建时问题。

Here's the error message: 这是错误消息:

AndroidManifest.xml:39: Tag <provider> attribute authorities has invalid character '$'.

I found, indeed, in the AndroidManifest.xml produced in the Temp/StagingArea folder the following lines: 我确实在Temp / StagingArea文件夹中生成的AndroidManifest.xml中找到以下几行:

 <!--
         The initialization ContentProvider will call FacebookSdk.sdkInitialize automatically
         with the application context. This config is merged in with the host app's manifest,
         but there can only be one provider with the same authority activated at any given
         point; so if the end user has two or more different apps that use Facebook SDK, only the
         first one will be able to use the provider. To work around this problem, we use the
         following placeholder in the authority to identify each host application as if it was
         a completely different provider.
        -->

    <provider android:authorities="${applicationId}.FacebookInitProvider" android:exported="false" android:name="com.facebook.internal.FacebookInitProvider" />

It looks like the applicationId substitution is not working, but I correctly place it in the Facebook Settings, as stated in the docs. 看起来applicationId替代项无法正常工作,但我已按照文档中所述正确地将其放置在Facebook设置中。

Tried it with Facebook SDK 7.10, 7.11 and 7.12 on Unity 2017.2 and 2018.1 in an empty project with just the Facebook SDK plugin installed. 在安装了Facebook SDK插件的空项目中,在Unity 2017.2和2018.1上使用Facebook SDK 7.10、7.11和7.12对其进行了尝试。

Anyone out there have any idea on what is happening here? 外面有人对这里发生的事情有任何想法吗?

尝试用您的应用程序ID替换它,$返回包名而不是appID。

<provider android:authorities="FacebookInitProvider{APP ID HERE}" android:exported="true" android:name="com.facebook.internal.FacebookInitProvider" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM