首页 文章

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

提问于
浏览
1

在为Android构建时,我无法解决此构建时问题 .

这是错误消息:

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

确实,我发现在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" />

看起来applicationId替换不起作用,但我正确地将它放在Facebook设置中,如文档中所述 .

在Unity 2017.2和2018.1上使用Facebook SDK 7.10,7.11和7.12在仅安装了Facebook SDK插件的空项目中尝试使用它 .

那里的任何人都知道这里发生了什么?

1 回答

  • 0

    尝试用你的app id替换它,$ return package name not appID .

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

相关问题