Open MizanurRemon opened 2 years ago
I got this error too. Mizanur, did you found any solution for it?
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: @.***>
Any update abuot this issue?
I got this error too. Mizanur, did you found any solution for it?
Nope. :
This comment helps solve it: https://github.com/Snapchat/creative-kit-sample/issues/33#issuecomment-1010529656
Issue still continues
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.
Issue still exists with 3.0.0
I receive the error message when sharing content to Snapchat.![Screenshot_20220414_013858_com snapchat android](https://user-images.githubusercontent.com/50514672/163257307-d7f58847-3a79-4131-87a3-d22cad9a756e.jpg)