在android中集成Freshdesk时出现文件提供程序异常

在android中集成Freshdesk时出现文件提供程序异常,android,freshdesk,Android,Freshdesk,我正在按照以下链接中提到的步骤将Freshdesk集成到android(Nougat)中: “” 我用最新版本的freshdesk在gradle文件中添加了依赖项。 在上面链接中提到的集成的第一步中,它说我们可能会得到以下错误作为Toast消息 “Freshchat缺少/错误的文件提供程序。在运行Nougat或更高版本操作系统的设备中,摄像头捕获将失败(错误代码354)” 为了避免这个错误,我在我的AndroidManifest.xml文件和字符串资源中为“freshchat\u file\u

我正在按照以下链接中提到的步骤将Freshdesk集成到android(Nougat)中:

“”

我用最新版本的freshdesk在gradle文件中添加了依赖项。 在上面链接中提到的集成的第一步中,它说我们可能会得到以下错误作为Toast消息

“Freshchat缺少/错误的文件提供程序。在运行Nougat或更高版本操作系统的设备中,摄像头捕获将失败(错误代码354)”

为了避免这个错误,我在我的AndroidManifest.xml文件和字符串资源中为“freshchat\u file\u provider\u authority”添加了以下代码。 字符串资源“freshchat\u file\u provider\u authority”和AndroidManifest.xml文件中的权限具有相同的包名

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="com.mypackage.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/freshchat_file_provider_paths" />
</provider>

<string name="freshchat_file_provider_authority">com.mypackage.provider</string>

com.mypackage.provider

但我还是遇到了同样的错误:“Freshchat缺少/错误的文件提供程序。在运行Nougat或更高版本操作系统的设备上,摄像头捕获将失败(错误代码354)”

请帮忙。
谢谢。

尝试将android:name=“android.support.v4.content.FileProvider”更改为android:name=“androidx.core.content.FileProvider”

您只需在values/strings.xml文件中添加以下行:

com.mypackage.provider
就这样。

AndroidManifest.xml

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="com.mypackage.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/freshchat_file_provider_paths" />
</provider>

values/strings.xml

<string name="freshchat_file_provider_authority">com.mypackage.provider</string>
com.mypackage.provider

但我还是遇到了同样的错误:“Freshchat缺少/错误的文件提供程序。在运行Nougat或更高版本操作系统的设备上,摄像头捕获将失败(错误代码354)”,请帮助。谢谢。这个解决方案对我不起作用。就连我也犯了同样的错误(我有这个提供商
com.freshdesk.helpdesk.provider
,做了你提到的同样的事情,但仍然面临同样的问题
<string name="freshchat_file_provider_authority">com.mypackage.provider</string>