-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error since firebase update on March 20th. Would you set firebase sdk version? #612
Comments
this is a critical issue. |
Hi, I have other error due to the same firebase update. When I type:
in the console, I get this output: BUILD FAILED Total time: 4.529 secs
I have been looking for the answer through the web but the solutions I found (solution1, solution2, solution3) doesn't work for me. The error appears to be due to the Play Services update. I cannot build my android app until I have remove this plugin. I hope this critical issue could be solve to install the plugin again. |
there is a temporary fix to this, force the services and firebase versions to 11.8.0. how to:
create the JS file on your project root:
create inside the src folder a android fodler and create inside that a file called build-extras.gradle with the content:
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. |
@tryadelion, I have tried your solution exactly as you mentioned, but I got the same error in console :( |
have you removed the platform, readded as android@6.3.0 and performed a "~: cordova build android", no prod, no run, no ionic? that's what did the trick for me! |
did you try any prior "hotfix" to this? like hand-changing the versions on the plugin's XML? i had to remove and readd it because i messed with it's files. it has worked so far on 3 different projects, all ionic though, but the hook system is the same as it's cordova powered. |
Before that, I have only changed /platforms/android/project.properties and /platforms/android/build.gradle but after that I have removed and re-added the plugin (first), and the platform android@6.3.0. (after). I don't know what could be the reason of the fail, butI think my project still have both versions: 12.0 and 11.8.0 because in the console I see this: I don't know where could be specified the 12.0.0 version. |
remove node-modules, remove platforms/android, remove every services-using plugin in /plugins, NPM i, readd every plugin that you removed, add platform android, and try again. that's what i would do. |
Ok, I'll try to re-install every component I have. Thank you very much for your help!! |
@tryadelion Thanks for sharing. I was about to fork cordova-plugin-firebase and force versions. Anyway, i implemented your solution. We are working with android@6.4.0 that is working as well. |
Finally I solve the problem modifying the file /platforms/android/build.gradle this way:
(Solution read from facebook/react-native#18479) Thanks again! |
For //before_build/010_add_gradle_extras.js
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
var platformDir = 'platforms/android';
var srcfile = path.join(rootdir, 'build-extras.gradle');
var destfile = path.join(rootdir, platformDir, 'build-extras.gradle');
var destdir = path.dirname(destfile);
if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {
fs.createReadStream(srcfile).pipe(fs.createWriteStream(destfile));
process.stdout.write('Hook: build-extras.gradle added');
} //build-extras.gradle
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 adding new android platform was also a key factor. |
@tryadelion, any idea why I get this error when I try your approach?
|
I did what jotefer said and it makes the build work. However, remote config stopped working. Any idea? |
Diving into the issue that fetch is not working I found out that it's because of the following exception which is being thrown when calling fetch: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArraySet" on path: DexPathList Any idea? |
@remisture i had that issue happen when another gradle file was still referencing 12.X, try build cleaning. |
I solved by updating
After:
Tested on android@6.3.0 |
Below is my entire build.gradle. Also has a useful bit at the end for changing the compile sdk for all projects
|
this appears to be fixed by installing cordova-android-play-services-gradle-release |
@soumak77 that works thanks |
Since : https://firebase.google.com/support/releases March 20th.
Error
The text was updated successfully, but these errors were encountered: