LoginSignup
15
13

More than 5 years have passed since last update.

Androidアプリをインストールできない INSTALL_FAILED_CONFLICTING_PROVIDER(-505)の対処法

Posted at

Google Play Services 8.3.0 で追加された新しいProviderで
com.google.android.gms.measurement.AppMeasurementContentProvider
という名前のandroid:authoritiesをすでに使っているアプリがインストール済みの状態で、同じProviderの設定をしているアプリをインストールしようすると「アプリをインストールできない」(エラーコード:-505(INSTALL_FAILED_CONFLICTING_PROVIDER) or プロバイダの認証が重複しています) が発生します。

Issue 784: Multiple apps using same authority provider name for AppMeasurementContentProvider
https://code.google.com/p/analytics-issues/issues/detail?id=784

Issue 189079: Error -505
https://code.google.com/p/android/issues/detail?id=189079

AndroidStudioの場合、application projectのbuild.gradleに以下のような
applicationIdを指定しておくと、providerのandroid:authoritiesの値にapplicationId
が含まれるので衝突は起きませんが、cordovaは最近までデフォルトでセットされていなかったようです。

build.grade
android {
 :
 :
 defaultConfig {
    applicationId = "your.applicationid.here"
 }

Gradle variable applicationId is not set, creates issue with Google Play services 8.3.0
https://issues.apache.org/jira/browse/CB-10014

if another app also includes the Google Play services library 8.3.0 it will fail to install on the device
with an INSTALL_FAILED_CONFLICTING_PROVIDER error because the name isn't unique

AndroidStudioの場合、リリースビルドで生成される
build/intermediates/manifests/release/AndroidManifest.xml
の中身が以下のようになっているかチェックします

<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="your.applicationid.google_measurement_service"
android:exported="false" tools:replace="android:authorities" />
15
13
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
13