when I place the
apply plugin: 'com.google.gms.google-services'
in library module in app level it show an error like
'Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension'
So I removed the plugin it build successfully. But the data is not store in FireStore. How can I store the data when I place the plugin in library module.
How to solve that problem ? Root level app module :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.vijayasrivudanti.pages"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.stripe:stripe-android:4.1.5'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.android.gms:play-services:11.4.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-firestore:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
testCompile 'junit:junit:4.12'
compile project(':pays')
}
apply plugin: 'com.google.gms.google-services'
Library app module :
// enter code here
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.stripe:stripe-android:4.1.5'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.android.gms:play-services:11.4.2'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-firestore:11.4.2'
//compile project(':ReactAndroid')
//compile (project(':react-native-firestack')){exclude group: 'com.google.android.gms' }
}
apply plugin: 'com.google.gms.google-services'