Skip to content

Instantly share code, notes, and snippets.

@jjvillavicencio
Last active March 26, 2018 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjvillavicencio/a3b5d863928b830b7564d43ccc71aacb to your computer and use it in GitHub Desktop.
Save jjvillavicencio/a3b5d863928b830b7564d43ccc71aacb to your computer and use it in GitHub Desktop.
Firebase_plugin
there is a temporary fix to this, force the services and firebase versions to 11.8.0.
how to:
put this inside the tag of config.xml with the content:
<hook src="fixFirebasePlugin.js" type="before_build" />
create the JS file on your project root:
module.exports = function(context) {
var fs = require('fs');
var path = require('path');
var rootdir = context.opts.projectRoot;
var platformDir = 'platforms/android';
//change the path to your external gradle file
var srcFile = path.join(rootdir, 'src/android/build-extras.gradle');
var destFile = path.join(rootdir, platformDir, 'build-extras.gradle');
console.log("copying "+srcFile+" to "+destFile);
fs.createReadStream(srcFile).pipe(fs.createWriteStream(destFile));
}
create inside the src folder a android fodler and create inside that a file called build-extras.gradle with the content:
configurations.all {
resolutionStrategy {
force "com.google.android.gms:play-services-ads:11.8.0"
force "com.google.android.gms:play-services-base:11.8.0"
force "com.google.android.gms:play-services-gcm:11.8.0"
force "com.google.android.gms:play-services-analytics:11.8.0"
force "com.google.android.gms:play-services-location:11.8.0"
force "com.google.android.gms:play-services-basement:11.8.0"
force "com.google.android.gms:play-services-tagmanager:11.8.0"
force 'com.google.firebase:firebase-core:11.8.0'
force 'com.google.firebase:firebase-crash:11.8.0'
force 'com.google.firebase:firebase-auth:11.8.0'
force 'com.google.firebase:firebase-common:11.8.0'
force 'com.google.firebase:firebase-config:11.8.0'
force 'com.google.firebase:firebase-messaging:11.8.0'
}
}
remove and re add platform (tested on 6.3.0), perform a cordova build android, and it's fixed.
after that, a run/build --prod, whatever you want.
I can verify.
The issue is indeed the unspecified "com.android.support:support-v4:+" version, this needs to be changed to "com.android.support:support-v4:23.+" and everything works again.
allprojects {
repositories {
//start here
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '11.8.0'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '11.8.0'
}
}
}
//end
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment