6

I am integrating Freshdesk in android(Nougat) following the steps mentioned in the link below:

"https://support.freshchat.com/support/solutions/articles/229319-freshchat-android-sdk-integration-steps"

I added the dependency in gradle file with latest version of freshdesk. In the first step for integration mentioned in the link above, it said we might get the following error as a Toast message

"Missing/Bad FileProvider for Freshchat. Camera capture will fail in devices running Nougat or later versions of OS (error code 354)"

To avoid the error, i added following code in my AndroidManifest.xml file and String resource for "freshchat_file_provider_authority". String resource "freshchat_file_provider_authority" and authorities in the AndroidManifest.xml file are having the same package names.

<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>

But Still i am getting the same error : "Missing/Bad FileProvider for Freshchat. Camera capture will fail in devices running Nougat or later versions of OS (error code 354)"

Please help. Thanks.

3 Answers3

4

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>
2

you just need to add this line bellow in values/strings.xml file:

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

and that's it.

hanae
  • 91
  • 4
  • 18
  • 1
    i habe this provider `com.freshdesk.helpdesk.provider` and done same thing which yo mentioned stil facing same issue – Arbaz.in Sep 23 '20 at 11:53
0

try changing android:name="android.support.v4.content.FileProvider" to android:name="androidx.core.content.FileProvider"

Milena -
  • 27
  • 3
  • 2
    But Still i am getting the same error : "Missing/Bad FileProvider for Freshchat. Camera capture will fail in devices running Nougat or later versions of OS (error code 354)" Please help. Thanks. – Firoz Jaroli Feb 12 '20 at 09:59
  • This solution didn't work for me. Even I'm also getting the same error. :( – Abhishek May 18 '20 at 14:23