0

We are preparing to publish our instant app, however, we are experiencing a security exception when attempting to initialize Google Maps. Below is the error that is occurring. After multiple attempts to resolve the issue and countless google searches, we have yet to find a solution. This issue is not happening for the installed app. Any help would be appreciated.

06-20 11:10:57.263 13891-13891/com.myapp.example.debug E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.myapp.example.debug, PID: 13891
                                                                           java.lang.SecurityException: Failed to find provider com.google.android.gsf.gservices for user 0; expected to find a valid ContentProvider for this authority

The build.gradle file associated with the instant app:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.22.2'
    }
}

apply plugin: 'com.android.instantapp'
apply plugin: 'io.fabric'

repositories {
    jcenter()
    flatDir {
        dirs '../libs'
    }
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

android {

    compileSdkVersion rootProject.compileSdk
    buildToolsVersion rootProject.buildTools

    def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()

    defaultConfig {
        minSdkVersion rootProject.minSdk
        targetSdkVersion rootProject.compileSdk
    }

    signingConfigs {

        flavor1Release {
            storeFile file('../publish/flavor1-release.keystore')
            storePassword System.getenv("FLAVOR_1_STORE_PASSWORD")
            keyAlias "flavor1"
            keyPassword System.getenv("FLAVOR_1_KEY_PASSWORD")
            v2SigningEnabled true
        }

        flavor2Release {
            storeFile file('../publish/flavor2-release.keystore')
            storePassword System.getenv("FLAVOR_2_STORE_PASSWORD")
            keyAlias "flavor2"
            keyPassword System.getenv("FLAVOR_2_KEY_PASSWORD")
            v2SigningEnabled true
        }

        debug {
            storeFile file('../publish/debug.keystore')
        }
    }

    flavorDimensions rootProject.flavorDimensions

    productFlavors {
        flavor1 {
            applicationId rootProject.flavor1PackageName
            versionCode rootProject.flavor1VersionCode
            versionName rootProject.flavor1VersionName

            dimension rootProject.flavorDimensions
        }

        flavor2 {
            applicationId rootProject.flavor2PackageName
            versionCode rootProject.flavor2VersionCode
            versionName rootProject.flavor2VersionName

            dimension rootProject.flavorDimensions
        }
    }

    buildTypes {

        debug {
            applicationIdSuffix ".debug"
            versionNameSuffix "-debug-${gitSha}"
            signingConfig signingConfigs.debug
        }

        release {
            productFlavors.flavor1.signingConfig signingConfigs.flavor1Release
            productFlavors.flavor2.signingConfig signingConfigs.flavor2Release
        }
    }
}

dependencies {
    implementation project(':features:base')
    implementation project(':features:auth')
    implementation project(':features:chat')
    implementation project(':features:filter')
    implementation project(':features:search')
    implementation project(':features:message')
}

Edit:

Resolved after updating gms libraries to 11.0.2

lgfz71
  • 81
  • 2
  • 7
  • Is this happening on O builds or all builds? – Anirudh Jun 21 '17 at 17:53
  • @Anirudh So far, the only time I am not able to reproduce this crash and successfully load a map instance is on an O Preview system image. – lgfz71 Jun 22 '17 at 20:32
  • which version of play services are you using? – AdamK Jun 26 '17 at 15:23
  • Please try again after updating to the latest libraries, currently at 11.0.4 https://developers.google.com/android/guides/releases (related: https://stackoverflow.com/questions/45089070/instant-app-crashing-on-adview-loadad-securityexception-failed-to-find-provide) – TWL Jul 27 '17 at 17:53
  • @lgfz71, i hope your problems has been solved with version 11.6.0, please confirm. – Prags Dec 09 '17 at 15:45

0 Answers0