Do not attempt to use google json (firebase) in a gradle library. The google-service plugin is made for applications only.
Otherwise you'll get obscure compilation errors.
This commit is contained in:
parent
c082aa52fd
commit
9b5f01341b
1 changed files with 6 additions and 24 deletions
|
@ -1,12 +1,8 @@
|
||||||
// Project information
|
// Project information
|
||||||
buildDir = 'bin'
|
buildDir = 'bin'
|
||||||
def firebaseEnable() {
|
|
||||||
File googleFile = new File('google-services.json')
|
|
||||||
return googleFile.exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
File googleFile = new File('google-services.json')
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -15,9 +11,6 @@ buildscript {
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.1.0'
|
classpath 'com.android.tools.build:gradle:3.1.0'
|
||||||
if (googleFile.exists()) {
|
|
||||||
classpath 'com.google.gms:google-services:3.1.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,28 +26,17 @@ allprojects {
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.16.1'
|
compile group: 'org.apache.commons', name: 'commons-compress', version: '+'
|
||||||
if (firebaseEnable()) {
|
compile 'com.android.support:support-v4:26.0.2'
|
||||||
implementation 'com.google.firebase:firebase-messaging:15.0.2'
|
|
||||||
} else {
|
|
||||||
implementation 'com.android.support:support-v4:26.0.1'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (firebaseEnable()) {
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def srcDirs = ['submodules/mediastreamer2/java/src', 'src/linphone-wrapper', 'src/android']
|
def srcDirs = ['submodules/mediastreamer2/java/src', 'src/linphone-wrapper', 'src/android']
|
||||||
|
|
||||||
def excludeFiles = []
|
def excludeFiles = []
|
||||||
// Exclude firebase file if not enable
|
|
||||||
if (!firebaseEnable()) {
|
|
||||||
excludeFiles.add('**/Firebase*')
|
excludeFiles.add('**/Firebase*')
|
||||||
} else {
|
|
||||||
excludeFiles.add('**/gcm*')
|
excludeFiles.add('**/gcm*')
|
||||||
}
|
|
||||||
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
|
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
|
||||||
|
|
||||||
def excludePackage = []
|
def excludePackage = []
|
||||||
|
|
Loading…
Reference in a new issue