wizpanda / cordova-plugin-firebase-lib

This repository is moving & merging to https://github.com/wizpanda/cordova-plugin-firebase-lib to avoid confusion to developers.
https://www.wizpanda.com/
MIT License
68 stars 38 forks source link

Version 3.3.0 not building for android 6.4.0 #38

Open dland512 opened 4 years ago

dland512 commented 4 years ago

Describe the bug

Will not build under Android. Note this does not seem to be quite the same issues as this one. In my case there is no real error message given. I'm using the same version of the cordova-android and cordova-plugin-firebase-lib they are.

To Reproduce

Add the plugin and build for android.

Steps to reproduce the behavior:

cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save
cordova build android

Expected behavior

Should build.

Console Logs

me$ cordova build android
Preparing Firebase on Android
ANDROID_HOME=/Users/me/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
Subproject Path: CordovaLib
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_5mn13fbytbeodrevlz8q7dmtz.run(/Users/me/my-app/platforms/android/build.gradle:148)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:preDebugBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

No real reason appears to be given. Including -d --debug or -d --stacktrace don't provide any more info.

Plugin Version

cordova-plugin-firebase-lib 3.3.0 "Google Firebase Plugin"

Desktop (please complete the following information):

Additional context

cordova version: 7.1.0 cordova-android version: 6.4.0

sagrawal31 commented 4 years ago

I just tried building with the same versions. Seems to be working for me. Can you provide me a sample repo reproducing your problem

dland512 commented 4 years ago

@sagrawal31 Okay, I created two repositories for you to try. The first one should immediately demonstrate the issue:

git clone https://github.com/dland512/firebase-lib-issue-with-plugin-2.git
cd firebase-lib-issue-with-plugin-2
cordova platform add android
cordova build android

You may need to run this under node v6.11.0 with npm 3.10.10. That's what it was originally built with and sometimes it has issues if you deviate.

If you get an error about vue-pusher when you run cordova platform add android just run it again.

For comparison, if you build it without cordova-plugin-firebase-lib installed, it works fine. I seem to have trouble actually removing the plugin once it's installed so I created a version that doesn't have it yet:

git clone https://github.com/dland512/firebase-lib-issue-without-plugin-2.git
cd firebase-lib-issue-without-plugin-2
cordova platform add android
cordova build android

Thank you for having a look at this for me and let me know how it goes.

sagrawal31 commented 4 years ago

I have got a fix for this. Will share you soon.

sagrawal31 commented 4 years ago

@dland512 I need to do a quick test. Can you open platforms/android/build.gradle, and in the start of the file, you will find buildscript -> repositories. Inside it, can you add google() in the start and then retry building the app?

dland512 commented 4 years ago

Didn't seem to fix it. This is what I ended up with:

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' } // Fabrics Maven repository from cordova-plugin-firebase-lib
        maven {
            url "https://maven.google.com"
        }
    }

Still getting the same error.