Snapchat / creative-kit-sample

Sample Apps For Creative Kit
Other
139 stars 86 forks source link

Error: Something went wrong #53

Open MizanurRemon opened 2 years ago

MizanurRemon commented 2 years ago

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

m-mirghafari commented 2 years ago

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

LiveEYE074 commented 2 years ago

Nope

On Tue, Jun 28, 2022, 1:41 AM Mahmoud Mirghafari @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/Snapchat/creative-kit-sample/issues/53#issuecomment-1168250110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZPBAVL2BPXQCZ73CNSYAGDVRKGBJANCNFSM5TLVWM7A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

xinayida commented 1 year ago

Any update abuot this issue?

MizanurRemon commented 1 year ago

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

Nope. :

ansh commented 1 year ago

This comment helps solve it: https://github.com/Snapchat/creative-kit-sample/issues/33#issuecomment-1010529656

iostyle commented 10 months ago

Issue still continues

Kaszmir commented 8 months ago

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 commented 5 months ago

Issue still exists with 3.0.0