Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Something went wrong #53

Open
MizanurRemon opened this issue Apr 13, 2022 · 8 comments
Open

Error: Something went wrong #53

MizanurRemon opened this issue Apr 13, 2022 · 8 comments

Comments

@MizanurRemon
Copy link

I receive the error message when sharing content to Snapchat.
Screenshot_20220414_013858_com snapchat android

@m-mirghafari
Copy link

I got this error too. Mizanur, did you found any solution for it?

@LiveEYE074
Copy link

LiveEYE074 commented Jun 28, 2022 via email

@xinayida
Copy link

xinayida commented Dec 5, 2022

Any update abuot this issue?

@MizanurRemon
Copy link
Author

I got this error too. Mizanur, did you found any solution for it?

Nope. :

@ansh
Copy link

ansh commented Dec 12, 2022

This comment helps solve it: #33 (comment)

@iostyle
Copy link

iostyle commented Aug 17, 2023

Issue still continues

@Kaszmir
Copy link

Kaszmir commented Oct 13, 2023

Hello, @iostyle,

In our experience with the snapchat_snap-kit-react-native Android native module in Flip, we encountered a common issue related to the "ERROR SOMETHING WENT WRONG, PLEASE TRY AGAIN" dialog message that appears after navigating to the Snapchat app. After thorough investigation, we identified the root cause, which was related to a conflict with another library using a FileProvider definition in its Manifest file.

The conflicting provider from the external library looked like this:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths" />
</provider>

On the other hand, Snap Kit required a distinct FileProvider definition:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
      android:name="android.support.FILE_PROVIDER_PATHS"
      android:resource="@xml/file_paths"
/>

Notably, the conflict arose from different authorities values while sharing the same name for the provider. Snap Kit obtains its FileProvider using the SnapUtils class:

public static String getFileProviderAuthority(@NonNull Context context) {
        return context.getPackageName() + ".fileprovider";
}

Unfortunately, we couldn't override this function to create our own FileProvider, which would have been ideal. As a solution, we had to create a custom FileProvider for the conflicting library. Creating a custom FileProvider is a straightforward process. It involves creating an empty class that extends FileProvider and adjusting the name value in the FileProvider Manifest declaration:

public class CustomFileProvider extends FileProvider {
}
<provider
    android:name=".CustomFileProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths" />
</provider>

In summary, make sure to double-check client ID values during such implementations. We hope this solution proves helpful to anyone facing challenges with sharing content through Snap Kit.

@donChelsea
Copy link

Issue still exists with 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants