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