When I download a my application from the Huawei AppGallery, a message is displayed indicating that the installation fails.
Opening the message and view the failure details.
The specific failure information is Conflicting Provider and Error Code is -13. In addition, the system displays the name of the application that conflicts with and the recommended solution. How can I solve this problem?
If a provider conflict occurs when you install an app, it is because an existing app has the same ContentProvider
.
The ContentProvider
feature interacts and shares data between processes, which determines that it must be globally unique. Once an app has registered a ContentProvider
on the phone, the app installed later cannot use the same ContentProvider
. Otherwise, the installation will fail.
The fix for this is to make sure that all ContentProvider
names are kept unique, best practice is to make your package namespace part of the provider definition in your manifest.
For example:
<provider
android:name="myapplication.android.hms.unity.provider.AnalyticsContentProvider"
android:exported="false"
android:grantUriPermissions="true"
/>